case RID_IS_ENUM:
case RID_IS_POD:
case RID_IS_POLYMORPHIC:
+ case RID_IS_STD_LAYOUT:
+ case RID_IS_TRIVIAL:
case RID_IS_UNION:
return cp_parser_trait_expr (parser, token->keyword);
case RID_IS_POLYMORPHIC:
kind = CPTK_IS_POLYMORPHIC;
break;
+ case RID_IS_STD_LAYOUT:
+ kind = CPTK_IS_STD_LAYOUT;
+ break;
+ case RID_IS_TRIVIAL:
+ kind = CPTK_IS_TRIVIAL;
+ break;
case RID_IS_UNION:
kind = CPTK_IS_UNION;
break;
tree identifier;
tree type = NULL_TREE;
tree attributes = NULL_TREE;
+ tree globalscope;
cp_token *token = NULL;
/* See if we're looking at the `enum' keyword. */
cp_lexer_consume_token (parser->lexer);
/* Remember that it's a `typename' type. */
tag_type = typename_type;
- /* The `typename' keyword is only allowed in templates. */
- if (!processing_template_decl)
- permerror (input_location, "using %<typename%> outside of template");
}
/* Otherwise it must be a class-key. */
else
}
/* Look for the `::' operator. */
- cp_parser_global_scope_opt (parser,
- /*current_scope_valid_p=*/false);
+ globalscope = cp_parser_global_scope_opt (parser,
+ /*current_scope_valid_p=*/false);
/* Look for the nested-name-specifier. */
- if (tag_type == typename_type)
+ if (tag_type == typename_type && !globalscope)
{
if (!cp_parser_nested_name_specifier (parser,
/*typename_keyword_p=*/true,