@@ -17576,8 +17576,8 @@ cp_parser_class_head (cp_parser* parser,
{
cp_parser_check_for_invalid_template_id (parser, id,
type_start_token->location);
- virt_specifiers = cp_parser_virt_specifier_seq_opt (parser);
}
+ virt_specifiers = cp_parser_virt_specifier_seq_opt (parser);
/* If it's not a `:' or a `{' then we can't really be looking at a
class-head, since a class-head only appears as part of a
@@ -28,6 +28,13 @@ struct B6 final final {}; // { dg-error "duplicate virt-specifier" }
struct B7 override {}; // { dg-error "cannot specify 'override' for a class" }
+namespace N
+{
+ struct C;
+}
+
+struct N::C final{};
+
int main()
{
D3<B1> d;