diff options
author | Adam Butcher <adam@jessamine.co.uk> | 2014-03-01 21:28:18 +0000 |
---|---|---|
committer | Adam Butcher <abutcher@gcc.gnu.org> | 2014-03-01 21:28:18 +0000 |
commit | 234b1504b16d0a273c9dac3698628c6d577d35eb (patch) | |
tree | 200bbc94d476d144195fcc8be93ea9eaa2826ecd /gcc | |
parent | 2ce298900287e37c7442a413f658608c8ae22833 (diff) | |
download | gcc-234b1504b16d0a273c9dac3698628c6d577d35eb.zip gcc-234b1504b16d0a273c9dac3698628c6d577d35eb.tar.gz gcc-234b1504b16d0a273c9dac3698628c6d577d35eb.tar.bz2 |
re PR c++/60377 ([c++1y] ICE with invalid function parameter in conjunction with auto parameter)
Fix PR c++/60377.
PR c++/60377
* parser.c (cp_parser_parameter_declaration_clause): Unwind generic
function scope on parse error in function parameter list.
PR c++/60377
* g++.dg/cpp1y/pr60377.C: New testcase.
From-SVN: r208250
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/parser.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp1y/pr60377.C | 9 |
4 files changed, 26 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4b6682a..2d8364b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2014-03-01 Adam Butcher <adam@jessamine.co.uk> + + PR c++/60377 + * parser.c (cp_parser_parameter_declaration_clause): Unwind generic + function scope on parse error in function parameter list. + 2014-03-01 Paolo Carlini <paolo.carlini@oracle.com> * method.c (implicitly_declare_fn): Remove redundant diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index ef36327..8c78262 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -18208,7 +18208,12 @@ cp_parser_parameter_declaration_clause (cp_parser* parser) parameter-declaration-list, then the entire parameter-declaration-clause is erroneous. */ if (is_error) - return NULL; + { + /* Unwind generic function template scope if necessary. */ + if (parser->fully_implicit_function_template_p) + finish_fully_implicit_template (parser, /*member_decl_opt=*/0); + return NULL; + } /* Peek at the next token. */ token = cp_lexer_peek_token (parser->lexer); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dd9dcba..2f05638 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-03-01 Adam Butcher <adam@jessamine.co.uk> + + PR c++/60377 + * g++.dg/cpp1y/pr60377.C: New testcase. + 2014-03-01 Mikael Morin <mikael@gcc.gnu.org> PR fortran/60341 diff --git a/gcc/testsuite/g++.dg/cpp1y/pr60377.C b/gcc/testsuite/g++.dg/cpp1y/pr60377.C new file mode 100644 index 0000000..4f6497c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/pr60377.C @@ -0,0 +1,9 @@ +// PR c++/60377 +// { dg-options -std=c++1y } + +void foo(auto, void (f*)()); // { dg-error "expected" } + +struct A +{ + int i; +}; |