Commit a480422d by Volker Reichelt Committed by Volker Reichelt

parser.c (cp_parser_nested_name_specifier_opt): Add fix-it information to…

parser.c (cp_parser_nested_name_specifier_opt): Add fix-it information to diagnostic of invalid colon in nested-name-specifier.

        * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
        information to diagnostic of invalid colon in nested-name-specifier.

        * g++.dg/diagnostic/nested-name-1.C: New test.

From-SVN: r247282
parent f88523e5
2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
* parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
information to diagnostic of invalid colon in nested-name-specifier.
2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
* parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
......
......@@ -5931,8 +5931,11 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser,
&& parser->colon_corrects_to_scope_p
&& cp_lexer_peek_nth_token (parser->lexer, 3)->type == CPP_NAME)
{
error_at (token->location,
"found %<:%> in nested-name-specifier, expected %<::%>");
gcc_rich_location richloc (token->location);
richloc.add_fixit_replace ("::");
error_at_rich_loc (&richloc,
"found %<:%> in nested-name-specifier, "
"expected %<::%>");
token->type = CPP_SCOPE;
}
2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
* g++.dg/diagnostic/nested-name-1.C: New test.
2017-04-26 Martin Liska <mliska@suse.cz>
* gcc.dg/guality/guality.h: Add prefix to test verification.
......
// { dg-options "-fdiagnostics-show-caret" }
namespace N
{
struct A {};
}
N:A a; /* { dg-error "nested-name-specifier" }
{ dg-begin-multiline-output "" }
N:A a;
^
::
{ dg-end-multiline-output "" } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment