+2016-08-30 David Malcolm <dmalcolm@redhat.com>
+
+ * parser.c (cp_parser_enclosed_template_argument_list): Add fix-it
+ hint to ">>" within nested template argument list error.
+
2016-08-30 David Malcolm <dmalcolm@redhat.com>
* name-lookup.c (suggest_alternatives_for): Use add_fixit_replace
global source location is still on the token before the
'>>', so we need to say explicitly where we want it. */
cp_token *token = cp_lexer_peek_token (parser->lexer);
- error_at (token->location, "%<>>%> should be %<> >%> "
- "within a nested template argument list");
+ gcc_rich_location richloc (token->location);
+ richloc.add_fixit_replace ("> >");
+ error_at_rich_loc (&richloc, "%<>>%> should be %<> >%> "
+ "within a nested template argument list");
token->type = CPP_GREATER;
}
+2016-08-30 David Malcolm <dmalcolm@redhat.com>
+
+ * g++.dg/template/double-greater-than-fixit.C: New test case.
+
2016-08-30 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/opt57.ad[sb]: New test.
--- /dev/null
+/* { dg-options "-fdiagnostics-show-caret -std=c++98" } */
+template <typename T>
+struct foo {};
+
+foo<foo<int>> i; // { dg-error "12: .>>. should be .> >. within a nested template argument list" }
+/* { dg-begin-multiline-output "" }
+ foo<foo<int>> i;
+ ^~
+ > >
+ { dg-end-multiline-output "" } */