+2012-10-15 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/50080
+ * parser.c (cp_parser_optional_template_keyword): Implement
+ Core/468, allow outside template.
+
2012-10-14 Jason Merrill <jason@redhat.com>
Ville Voutilainen <ville.voutilainen@gmail.com>
{
if (cp_lexer_next_token_is_keyword (parser->lexer, RID_TEMPLATE))
{
- /* The `template' keyword can only be used within templates;
- outside templates the parser can always figure out what is a
- template and what is not. */
- if (!processing_template_decl)
- {
- cp_token *token = cp_lexer_peek_token (parser->lexer);
- error_at (token->location,
- "%<template%> (as a disambiguator) is only allowed "
- "within templates");
- /* If this part of the token stream is rescanned, the same
- error message would be generated. So, we purge the token
- from the stream. */
- cp_lexer_purge_token (parser->lexer);
- return false;
- }
- else
- {
- /* Consume the `template' keyword. */
- cp_lexer_consume_token (parser->lexer);
- return true;
- }
+ /* Consume the `template' keyword. */
+ cp_lexer_consume_token (parser->lexer);
+ return true;
}
-
return false;
}
+2012-10-15 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/50080
+ * g++.dg/parse/tmpl-outside2.C: New.
+ * g++.dg/parse/tmpl-outside1.C: Adjust.
+ * g++.dg/template/qualttp18.C: Likewise.
+ * g++.old-deja/g++.pt/memtemp87.C: Likewise.
+ * g++.old-deja/g++.pt/overload13.C: Likewise.
+
2012-10-15 Marc Glisse <marc.glisse@inria.fr>
PR tree-optimization/54915