]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/26070 (ICE declaring data member virtual and static)
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Wed, 8 Feb 2006 11:08:04 +0000 (11:08 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Wed, 8 Feb 2006 11:08:04 +0000 (11:08 +0000)
PR c++/26070
* decl.c (grokdeclarator): Clear RID_STATIC together with staticp.

* g++.dg/other/virtual1.C: New test.

From-SVN: r110750

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/virtual1.C [new file with mode: 0644]

index da47e4854b19264d1ac68a4c5e3ccead833b340f..98588f75601037d9d326a650315c1cfadef5c28e 100644 (file)
@@ -1,3 +1,8 @@
+2006-02-08  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/26070
+       * decl.c (grokdeclarator): Clear RID_STATIC together with staticp.
+
 2006-02-01  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        Backport:
index 74a386d941db38fb3f7cfbf90826df836679e680..299ff8823420f38f39f5fd6f894c9cfb140950ac 100644 (file)
@@ -7188,8 +7188,8 @@ grokdeclarator (tree declarator,
 
   if (virtualp && staticp == 2)
     {
-      error ("member `%D' cannot be declared both virtual and static",
-               dname);
+      error ("member `%D' cannot be declared both virtual and static", dname);
+      RIDBIT_RESET (RID_STATIC, specbits);
       staticp = 0;
     }
   friendp = RIDBIT_SETP (RID_FRIEND, specbits);
index 6040ed2d972f3df809329e7386d44394ca3c00e1..ce81d3ee26962aeb177037ca080d622a7a9a8b5d 100644 (file)
@@ -1,3 +1,8 @@
+2006-02-08  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/26070
+       * g++.dg/other/virtual1.C: New test.
+
 2006-02-01  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        Backport:
diff --git a/gcc/testsuite/g++.dg/other/virtual1.C b/gcc/testsuite/g++.dg/other/virtual1.C
new file mode 100644 (file)
index 0000000..5f44fa7
--- /dev/null
@@ -0,0 +1,7 @@
+// PR c++/26070
+// { dg-do compile }
+
+struct A
+{
+  virtual static int i;  // { dg-error "virtual" }
+};