static tree cp_parser_type_parameter
(cp_parser *, bool *);
static tree cp_parser_template_id
- (cp_parser *, bool, bool, bool);
+ (cp_parser *, bool, bool, enum tag_types, bool);
static tree cp_parser_template_name
- (cp_parser *, bool, bool, bool, bool *);
+ (cp_parser *, bool, bool, bool, enum tag_types, bool *);
static tree cp_parser_template_argument_list
(cp_parser *);
static tree cp_parser_template_argument
id = cp_parser_template_id (parser,
/*template_keyword_p=*/false,
/*check_dependency_p=*/true,
+ none_type,
declarator_p);
/* If that worked, we're done. */
if (cp_parser_parse_definitely (parser))
/* Try a template-id. */
id = cp_parser_template_id (parser, template_keyword_p,
check_dependency_p,
+ none_type,
declarator_p);
/* If it worked, we're done. */
if (cp_parser_parse_definitely (parser))
case CPP_TEMPLATE_ID:
return cp_parser_template_id (parser, template_keyword_p,
check_dependency_p,
+ none_type,
declarator_p);
case CPP_COMPL:
/* Try a template-id. */
id = cp_parser_template_id (parser, template_keyword_p,
/*check_dependency_p=*/true,
+ none_type,
declarator_p);
/* If that worked, we're done. */
if (cp_parser_parse_definitely (parser))
cp_parser_template_id (parser,
/*template_keyword_p=*/true,
/*check_dependency_p=*/false,
+ class_type,
/*is_declaration=*/true);
/* Look for the `::' token. */
cp_parser_require (parser, CPP_SCOPE, RT_SCOPE);
cp_parser_template_id (cp_parser *parser,
bool template_keyword_p,
bool check_dependency_p,
+ enum tag_types tag_type,
bool is_declaration)
{
int i;
templ = cp_parser_template_name (parser, template_keyword_p,
check_dependency_p,
is_declaration,
+ tag_type,
&is_identifier);
if (templ == error_mark_node || is_identifier)
{
bool template_keyword_p,
bool check_dependency_p,
bool is_declaration,
+ enum tag_types tag_type,
bool *is_identifier)
{
tree identifier;
/* Look up the name. */
decl = cp_parser_lookup_name (parser, identifier,
- none_type,
+ tag_type,
/*is_template=*/true,
/*is_namespace=*/false,
check_dependency_p,
type = cp_parser_template_id (parser,
/*template_keyword_p=*/true,
/*check_dependency_p=*/true,
+ none_type,
/*is_declaration=*/false);
/* If the template-id did not name a type, we are out of
luck. */
type_decl = cp_parser_template_id (parser,
/*template_keyword_p=*/false,
/*check_dependency_p=*/false,
+ none_type,
/*is_declaration=*/false);
/* Note that this must be an instantiation of an alias template
because [temp.names]/6 says:
token = cp_lexer_peek_token (parser->lexer);
decl = cp_parser_template_id (parser, template_p,
/*check_dependency_p=*/true,
+ tag_type,
is_declaration);
/* If we didn't find a template-id, look for an ordinary
identifier. */
/* Try a template-id. */
decl = cp_parser_template_id (parser, template_keyword_p,
check_dependency_p,
+ tag_type,
is_declaration);
if (decl == error_mark_node)
return error_mark_node;
= cp_parser_nested_name_specifier_opt (parser,
/*typename_keyword_p=*/false,
/*check_dependency_p=*/false,
- /*type_p=*/false,
+ /*type_p=*/true,
/*is_declaration=*/false);
/* If there was a nested-name-specifier, then there *must* be an
identifier. */
id = cp_parser_template_id (parser,
/*template_keyword_p=*/false,
/*check_dependency_p=*/true,
+ class_key,
/*is_declaration=*/true);
/* If that didn't work, it could still be an identifier. */
if (!cp_parser_parse_definitely (parser))