From: Jason Merrill Date: Fri, 11 Jan 2019 22:37:01 +0000 (-0500) Subject: PR c++/88312 - pack expansion of decltype. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3ddf08b3b8ed5b0b0fe6c930eefb97228ae80caa;p=gcc.git PR c++/88312 - pack expansion of decltype. The standard doesn't really talk about an expression depending on the number of elements of a pack, but that's definitely an important form of template argument dependence. * pt.c (instantiation_dependent_r): A template non-type parameter pack is instantiation-dependent. From-SVN: r267860 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9208f1e4937..0eb669b3eac 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2019-01-11 Jason Merrill + + PR c++/88312 - pack expansion of decltype. + * pt.c (instantiation_dependent_r): A template non-type parameter + pack is instantiation-dependent. + 2019-01-11 Jason Merrill PR c++/88613 - ICE with use of const var in lambda. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 84f59a2c356..f062a2b9707 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -25736,6 +25736,8 @@ instantiation_dependent_r (tree *tp, int *walk_subtrees, case TEMPLATE_PARM_INDEX: if (dependent_type_p (TREE_TYPE (*tp))) return *tp; + if (TEMPLATE_PARM_PARAMETER_PACK (*tp)) + return *tp; /* We'll check value-dependence separately. */ return NULL_TREE; diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-decltype1.C b/gcc/testsuite/g++.dg/cpp0x/variadic-decltype1.C new file mode 100644 index 00000000000..c87c6bad59f --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic-decltype1.C @@ -0,0 +1,9 @@ +// PR c++/88555 +// { dg-do compile { target c++11 } } + +template struct T {}; + +template +void test() { + using Test = T; +}