diff options
author | Adam Butcher <adam@jessamine.co.uk> | 2014-03-29 19:23:44 +0000 |
---|---|---|
committer | Adam Butcher <abutcher@gcc.gnu.org> | 2014-03-29 19:23:44 +0000 |
commit | 4b0040a6a506a01a3f001f9d3be08bb75036eec5 (patch) | |
tree | a3f060945b4dda1dcf23301e7d5d7e77f32baf8d | |
parent | cfdc23868bf063bd21d0913092e8f4a4a761de5f (diff) | |
download | gcc-4b0040a6a506a01a3f001f9d3be08bb75036eec5.zip gcc-4b0040a6a506a01a3f001f9d3be08bb75036eec5.tar.gz gcc-4b0040a6a506a01a3f001f9d3be08bb75036eec5.tar.bz2 |
re PR c++/60626 ([c++1y] ICE with pointer to function with auto parameter)
Fix PR c++/60626
PR c++/60626
* parser.c (cp_parser_init_declarator): Handle erroneous generic type
usage in non-functions with pushed scope.
PR c++/60626
* g++.dg/cpp1y/pr60626.C: New testcase.
From-SVN: r208940
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/parser.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp1y/pr60626.C | 7 |
4 files changed, 26 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 49f0d4a..aca5f44 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2014-03-29 Adam Butcher <adam@jessamine.co.uk> + + PR c++/60626 + * parser.c (cp_parser_init_declarator): Handle erroneous generic type + usage in non-functions with pushed scope. + 2014-03-28 Adam Butcher <adam@jessamine.co.uk> PR c++/60573 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 5d8446d..7bea3d2 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -16829,7 +16829,14 @@ cp_parser_init_declarator (cp_parser* parser, been issued. */ if (parser->fully_implicit_function_template_p) if (!function_declarator_p (declarator)) - finish_fully_implicit_template (parser, /*member_decl_opt=*/0); + { + if (pushed_scope) + { + pop_scope (pushed_scope); + pushed_scope = 0; + } + finish_fully_implicit_template (parser, /*member_decl_opt=*/0); + } /* For an in-class declaration, use `grokfield' to create the declaration. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e2031db..49000c3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-03-29 Adam Butcher <adam@jessamine.co.uk> + + PR c++/60626 + * g++.dg/cpp1y/pr60626.C: New testcase. + 2014-03-29 Joseph Myers <joseph@codesourcery.com> * gcc.dg/pr45416.c: Allow bextr on x86. diff --git a/gcc/testsuite/g++.dg/cpp1y/pr60626.C b/gcc/testsuite/g++.dg/cpp1y/pr60626.C new file mode 100644 index 0000000..39ea438 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/pr60626.C @@ -0,0 +1,7 @@ +// PR c++/60626 +// { dg-do compile { target c++1y } } +// { dg-options "" } + +struct A {}; + +void (*A::p)(auto) = 0; // { dg-error "static member|non-template" } |