]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR c++/26070
authorreichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Feb 2006 11:00:55 +0000 (11:00 +0000)
committerreichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Feb 2006 11:00:55 +0000 (11:00 +0000)
* decl.c (grokdeclarator): Clear storage_class together with staticp.

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

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

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

index e9040ee75a94f964b7ef2a86e71b39a64ebe588c..aa9aebf6062d0cdfc3a763fe97f443854ab7ae66 100644 (file)
@@ -1,3 +1,8 @@
+2006-02-08  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/26070
+       * decl.c (grokdeclarator): Clear storage_class together with staticp.
+
 2006-02-07  Gabriel Dos Reis  <gdr@integrable-solutions.net>
 
        * cp-tree.h (tf_warning_or_error): Renamed from tf_warn_or_error.
index 2b8207353900b19d98506747be6a4410f1d1bfa4..7fdb1743f4ce5f4174e07fc1997d27fb8c49143e 100644 (file)
@@ -7128,6 +7128,7 @@ grokdeclarator (const cp_declarator *declarator,
   if (virtualp && staticp == 2)
     {
       error ("member %qD cannot be declared both virtual and static", dname);
+      storage_class = sc_none;
       staticp = 0;
     }
   friendp = !! declspecs->specs[(int)ds_friend];
index 1211596cb86f564f2d444cc3a2a32ca549d3a7d3..821dc85a5e31ae15a5b0271e0f7e7547da21f52f 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-08  Paolo Bonzini  <bonzini@gnu.org>
 
        * lib/gcc-dg.exp (cleanup-rtl-dump, cleanup-tree-dump,
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" }
+};