+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
&& 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.
--- /dev/null
+// { 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 "" } */