On 11/21/18 10:55 AM, Jakub Jelinek wrote:
Hi!
On Tue, Nov 20, 2018 at 04:32:26PM -0500, David Malcolm wrote:
This makes the fix-it hint wrong: after the fix-it is applied, it will
become
return color;
(which won't compile), rather than
return O::color;
which will.
Here is an updated version of the patch, which still uses the whole
range of the id-expression when it is parsed as primary expression, but does
so not in cp_parser_id_expression, but in cp_parser_primary_expression after
all the diagnostics. Thus all the spell-checking etc. tests behave as
previously, they underline only the part after the last ::, and just
what uses the expression later on uses whole range.
The remaining needed tweeks in the testcases are minor and look correct to
me, e.g. for D::Bar the column is not at D but at B,
Sounds good.
similarly for operator"" _F the column is under _ rather than first o.
I disagree with this one: the name of the declaration is operator""_F,
so I think the caret should go at the first o.
The libstdc++ changes are because there are several large expressions like:
something<one, two,
three, four,
five, six>::value
and we used to diagnose on the something line (column of s)
but now we warn on value line (column of v).
Makes sense.
Jason