From: Jason Merrill Date: Thu, 25 Dec 2014 07:27:54 +0000 (-0500) Subject: re PR c++/63522 (ICE: unexpected expression 'ElementIndices' of kind template_parm_index) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=17e87c1ca5476117c64c69a9777226af70dd4394;p=gcc.git re PR c++/63522 (ICE: unexpected expression 'ElementIndices' of kind template_parm_index) PR c++/63522 * parser.c (cp_parser_type_parameter): Call check_for_bare_parameter_packs on default argument. From-SVN: r219066 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index cf5ab7102b5..4eb87127342 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2014-12-25 Jason Merrill + + PR c++/63522 + * parser.c (cp_parser_type_parameter): Call + check_for_bare_parameter_packs on default argument. + 2014-12-24 Paolo Carlini PR c++/63985 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index e57a5bd6802..2af15763ce3 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -13499,6 +13499,8 @@ cp_parser_type_parameter (cp_parser* parser, bool *is_parameter_pack) "default arguments"); default_argument = NULL_TREE; } + else if (check_for_bare_parameter_packs (default_argument)) + default_argument = error_mark_node; pop_deferring_access_checks (); } else diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic164.C b/gcc/testsuite/g++.dg/cpp0x/variadic164.C new file mode 100644 index 00000000000..8f9cdb18c2d --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic164.C @@ -0,0 +1,12 @@ +// PR c++/63522 +// { dg-do compile { target c++11 } } + +template struct tuple; +template void slice(); +template using slice_result = decltype(slice); +template , + slice_result...>::type> // { dg-error "parameter pack" } +void zip_with(Tuple...); +decltype(zip_with(0)) d; // { dg-error "no match" } diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-34052.C b/gcc/testsuite/g++.dg/cpp0x/vt-34052.C index 1036537eb9c..31d283131a3 100644 --- a/gcc/testsuite/g++.dg/cpp0x/vt-34052.C +++ b/gcc/testsuite/g++.dg/cpp0x/vt-34052.C @@ -1,8 +1,8 @@ // { dg-do compile { target c++11 } } -template struct A {}; // { dg-error "must be at the end" } +template struct A {}; // { dg-error "parameter pack" } -template class U> struct B // { dg-error "must be at the end" } +template class U> struct B // { dg-error "parameter pack" } { - template U foo(); // { dg-error "mismatch|constant|invalid|invalid" } + template U foo(); // { dg-error "mismatch|constant|wrong|invalid" } };