From: Simon Martin Date: Tue, 8 Jul 2008 18:41:35 +0000 (+0000) Subject: re PR c++/34963 (ICE completely broken destructor) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ff7437d0772a8a4a69b1eea2aade9835bbbe76fc;p=gcc.git re PR c++/34963 (ICE completely broken destructor) gcc/cp/ 2008-07-08 Simon Martin 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 PR c++/34963 * g++.dg/parse/dtor13.C: New test. From-SVN: r137637 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5ef7e2e1005..75435cffda6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2008-07-08 Simon Martin + + 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 PR c++/36128 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index a5a5574d7b4..fc76ebefb43 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f73e0443f8a..07b3827c2e7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-07-08 Simon Martin + + PR c++/34963 + * g++.dg/parse/dtor13.C: New test. + 2008-07-07 H.J. Lu * 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 index 00000000000..66cd5f7f34c --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/dtor13.C @@ -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" } */ +}; +