diff options
author | Adam Butcher <adam@jessamine.co.uk> | 2014-03-24 20:40:15 +0000 |
---|---|---|
committer | Adam Butcher <abutcher@gcc.gnu.org> | 2014-03-24 20:40:15 +0000 |
commit | 21554a3e268a90a78cf0f4c6b8221361a8eced98 (patch) | |
tree | 782efaf4122cae5b9378a5a23ca628cea7393a00 | |
parent | 09f15d1b52b9e1e37dc02c8674c8738a1b036ea7 (diff) | |
download | gcc-21554a3e268a90a78cf0f4c6b8221361a8eced98.zip gcc-21554a3e268a90a78cf0f4c6b8221361a8eced98.tar.gz gcc-21554a3e268a90a78cf0f4c6b8221361a8eced98.tar.bz2 |
re PR c++/60627 ([c++1y] ICE in explicit template instantiation containing auto parameter)
Fix PR c++/60627
PR c++/60627
* parser.c (cp_parser_parameter_declaration_clause): Prevent 'auto' from
introducing an implicit function template parameter within an explicit
instantiation.
PR c++/60627
* g++.dg/cpp1y/pr60627.C: New testcase.
From-SVN: r208799
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/parser.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp1y/pr60627.C | 12 |
4 files changed, 27 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7dfb34f..e022990 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2014-03-24 Adam Butcher <adam@jessamine.co.uk> + + PR c++/60627 + * parser.c (cp_parser_parameter_declaration_clause): Prevent 'auto' from + introducing an implicit function template parameter within an explicit + instantiation. + 2014-03-22 Jason Merrill <jason@redhat.com> PR c++/60574 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 46e2453..4ca08a1 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -18207,7 +18207,9 @@ cp_parser_parameter_declaration_clause (cp_parser* parser) (void) cleanup; - if (!processing_specialization && !processing_template_parmlist) + if (!processing_specialization + && !processing_template_parmlist + && !processing_explicit_instantiation) if (!current_function_decl || (current_class_type && LAMBDA_TYPE_P (current_class_type))) parser->auto_is_implicit_function_template_parm_p = true; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a07de06..9f9422a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-03-24 Adam Butcher <adam@jessamine.co.uk> + + PR c++/60627 + * g++.dg/cpp1y/pr60627.C: New testcase. + 2014-03-24 Alex Velenko <Alex.Velenko@arm.com> * gcc.target/aarch64/ushr64_1.c: New. diff --git a/gcc/testsuite/g++.dg/cpp1y/pr60627.C b/gcc/testsuite/g++.dg/cpp1y/pr60627.C new file mode 100644 index 0000000..9e2116e --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/pr60627.C @@ -0,0 +1,12 @@ +// PR c++/60627 +// { dg-do compile { target c++1y } } +// { dg-options "" } + +template<typename T> void foo(T) {} + +template void foo(auto); // { dg-error "auto|does not match" } + +void bar() +{ + foo(0); +} |