re PR c++/34963 (ICE completely broken destructor)
authorSimon Martin <simartin@users.sourceforge.net>
Tue, 8 Jul 2008 18:41:35 +0000 (18:41 +0000)
committerSimon Martin <simartin@gcc.gnu.org>
Tue, 8 Jul 2008 18:41:35 +0000 (18:41 +0000)
gcc/cp/

2008-07-08  Simon Martin  <simartin@users.sourceforge.net>

PR c++/34963
* decl.c (grokdeclarator): Reset storage_class and staticp for friend
functions declared with a storage class qualifier.

gcc/testsuite/

2008-07-08  Simon Martin  <simartin@users.sourceforge.net>

PR c++/34963
* g++.dg/parse/dtor13.C: New test.

From-SVN: r137637

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

index 5ef7e2e10054ce151b5aebbf070244d28b56cbf3..75435cffda6008f74aba48f8cdc6b2d5b5a956ea 100644 (file)
@@ -1,3 +1,9 @@
+2008-07-08  Simon Martin  <simartin@users.sourceforge.net>
+
+       PR c++/34963
+       * decl.c (grokdeclarator): Reset storage_class and staticp for friend
+       functions declared with a storage class qualifier.
+
 2008-07-03  Richard Guenther  <rguenther@suse.de>
 
        PR c++/36128
index a5a5574d7b4d29061462fde72dd41cb814f99133..fc76ebefb43fe2a92b983c30c01fcf8ea2632b56 100644 (file)
@@ -8036,7 +8036,11 @@ grokdeclarator (const cp_declarator *declarator,
     }
 
   if (storage_class && friendp)
-    error ("storage class specifiers invalid in friend function declarations");
+    {
+      error ("storage class specifiers invalid in friend function declarations");
+      storage_class = sc_none;
+      staticp = 0;
+    }
 
   if (!id_declarator)
     unqualified_id = NULL_TREE;
index f73e0443f8a6f2ece81ddd2c9e73629e3ebfe09e..07b3827c2e71fbbd3c38c31680eb2894bd28840a 100644 (file)
@@ -1,3 +1,8 @@
+2008-07-08  Simon Martin  <simartin@users.sourceforge.net>
+
+       PR c++/34963
+       * g++.dg/parse/dtor13.C: New test.
+
 2008-07-07  H.J. Lu  <hongjiu.lu@intel.com>
 
        * gcc.dg/compat/struct-layout-1_generate.c (vector_types): Add
diff --git a/gcc/testsuite/g++.dg/parse/dtor13.C b/gcc/testsuite/g++.dg/parse/dtor13.C
new file mode 100644 (file)
index 0000000..66cd5f7
--- /dev/null
@@ -0,0 +1,8 @@
+/* PR c++/34963 This used to ICE */
+/* { dg-do "compile" } */
+
+struct A
+{
+  static friend A::~A(); /* { dg-error "storage class specifiers|extra qualification|implicitly friend" } */
+};
+