static void
cp_parser_diagnose_invalid_type_name (cp_parser *parser, tree scope, tree id)
-{\r
- tree decl, old_scope;\r
+{
+ tree decl, old_scope;
/* Try to lookup the identifier. */
old_scope = parser->scope;
parser->scope = scope;
/* If the lookup found a template-name, it means that the user forgot
to specify an argument list. Emit an useful error message. */
if (TREE_CODE (decl) == TEMPLATE_DECL)
- error ("invalid use of template-name `%E' without an argument list",\r
- decl);\r
+ error ("invalid use of template-name `%E' without an argument list",
+ decl);
else if (!parser->scope)
{
/* Issue an error message. */
static tree
cp_parser_make_typename_type (cp_parser *parser, tree scope, tree id)
-{\r
- tree result;\r
- if (TREE_CODE (id) == IDENTIFIER_NODE)\r
- {\r
- result = make_typename_type (scope, id, /*complain=*/0);\r
- if (result == error_mark_node)\r
- cp_parser_diagnose_invalid_type_name (parser, scope, id);\r
- return result;\r
- }\r
- return make_typename_type (scope, id, tf_error);\r
+{
+ tree result;
+ if (TREE_CODE (id) == IDENTIFIER_NODE)
+ {
+ result = make_typename_type (scope, id, /*complain=*/0);
+ if (result == error_mark_node)
+ cp_parser_diagnose_invalid_type_name (parser, scope, id);
+ return result;
+ }
+ return make_typename_type (scope, id, tf_error);
}
cp_lexer_consume_token (parser->lexer);
}
}
- else
- cp_parser_require (parser, CPP_GREATER, "`>'");
+ else if (!cp_parser_require (parser, CPP_GREATER, "`>'"))
+ error ("missing `>' to terminate the template argument list");
/* The `>' token might be a greater-than operator again now. */
parser->greater_than_is_operator_p
= saved_greater_than_is_operator_p;