From: Jason Merrill Date: Wed, 21 Feb 2018 14:25:54 +0000 (-0500) Subject: PR c++/84454 - ICE with pack expansion in signature. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e68757438d8f5b6eacc8b95798835aada2b11668;p=gcc.git PR c++/84454 - ICE with pack expansion in signature. * error.c (find_typenames_r): Also stop on EXPR_PACK_EXPANSION. From-SVN: r257875 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index dd408e0bf68..76dce820aa8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2018-02-21 Jason Merrill + + PR c++/84454 - ICE with pack expansion in signature. + * error.c (find_typenames_r): Also stop on EXPR_PACK_EXPANSION. + 2018-02-20 Siddhesh Poyarekar * cp-objcp-common.c (cxx_block_may_fallthru): Add case for diff --git a/gcc/cp/error.c b/gcc/cp/error.c index cb1dcf36201..75e853a1428 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -1472,7 +1472,7 @@ find_typenames_r (tree *tp, int *walk_subtrees, void *data) /* Add the typename without any cv-qualifiers. */ mv = TYPE_MAIN_VARIANT (*tp); - if (TREE_CODE (*tp) == TYPE_PACK_EXPANSION) + if (PACK_EXPANSION_P (*tp)) { /* Don't mess with parameter packs since we don't remember the pack expansion context for a particular typename. */ diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic172.C b/gcc/testsuite/g++.dg/cpp0x/variadic172.C new file mode 100644 index 00000000000..d25d3029a9d --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic172.C @@ -0,0 +1,20 @@ +// PR c++/84454 +// { dg-do compile { target c++11 } } + +template +void +g(F&&, A&&...) +{} + +template +auto +h(A&&... a) -> decltype(g(0, g(a)...)) +{ + g(a...); // { dg-error "no match" } +} + +int +main() +{ + h(); +}