Commit 3ddf08b3 by Jason Merrill Committed by Jason Merrill

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
parent f43e0585
2019-01-11 Jason Merrill <jason@redhat.com>
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 <jason@redhat.com>
PR c++/88613 - ICE with use of const var in lambda.
* expr.c (mark_use): Fix location wrapper handling.
* cp-gimplify.c (cp_fold_maybe_rvalue): Call mark_rvalue_use.
......
......@@ -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;
......
// PR c++/88555
// { dg-do compile { target c++11 } }
template <class ...> struct T {};
template <int ...Indices>
void test() {
using Test = T<decltype((Indices, char(0)))...>;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment