OSDN Git Service

PR c++/50811
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 Oct 2011 13:31:21 +0000 (13:31 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 Oct 2011 13:31:21 +0000 (13:31 +0000)
* parser.c (cp_parser_class_head): Parse virt-specifiers
regardless of whether an id is present

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180301 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/override2.C

index df7e1bc..11994ee 100644 (file)
@@ -1,3 +1,9 @@
+2011-10-21  Ville Voutilainen  <ville.voutilainen@gmail.com>
+
+       PR c++/50811
+       * parser.c (cp_parser_class_head): Parse virt-specifiers
+       regardless of whether an id is present
+
 2011-10-20  Jason Merrill  <jason@redhat.com>
 
        PR c++/41449
index 8d138fb..a762d9d 100644 (file)
@@ -17853,8 +17853,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
index b70d758..a1b2752 100644 (file)
@@ -1,3 +1,8 @@
+2011-10-21  Ville Voutilainen  <ville.voutilainen@gmail.com>
+
+       PR c++/50811
+       * g++.dg/cpp0x/override2.C: Add test.
+
 2011-10-21  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * lib/gcc-dg.exp (GCC_UNDER_TEST): Set before calling
index 7f17504..0d8871d 100644 (file)
@@ -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;