===================================================================
@@ -16142,20 +16142,13 @@ cp_parser_alias_declaration (cp_parser* parser)
if (parser->num_template_parameter_lists)
parser->type_definition_forbidden_message = saved_message;
- if (type == error_mark_node)
+ if (type == error_mark_node
+ || !cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON))
{
cp_parser_skip_to_end_of_block_or_statement (parser);
return error_mark_node;
}
- cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON);
-
- if (cp_parser_error_occurred (parser))
- {
- cp_parser_skip_to_end_of_block_or_statement (parser);
- return error_mark_node;
- }
-
/* A typedef-name can also be introduced by an alias-declaration. The
identifier following the using keyword becomes a typedef-name. It has
the same semantics as if it were introduced by the typedef
===================================================================
@@ -0,0 +1,4 @@
+// PR c++/59120
+// { dg-do compile { target c++11 } }
+
+template<typename T> using X = int T::T*; // { dg-error "expected" }