re PR c++/63528 (A variadic variable template cannot use the ::value of a variadic trait)

PR c++/63528
	* pt.c (lookup_template_variable): Call coerce_template_parms.

From-SVN: r216279
This commit is contained in:
Jason Merrill 2014-10-15 13:42:07 -04:00 committed by Jason Merrill
parent 48fb6d4090
commit a0272f8660
3 changed files with 24 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2014-10-15 Jason Merrill <jason@redhat.com>
PR c++/63528
* pt.c (lookup_template_variable): Call coerce_template_parms.
2014-10-15 Paolo Carlini <paolo.carlini@oracle.com>
* semantics.c (is_instantiation_of_constexpr, literal_type_p,

View File

@ -7993,6 +7993,10 @@ lookup_template_variable (tree templ, tree arglist)
type = unknown_type_node;
else
type = TREE_TYPE (templ);
tsubst_flags_t complain = tf_warning_or_error;
tree parms = INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (templ));
arglist = coerce_template_parms (parms, arglist, templ, complain,
/*req_all*/true, /*use_default*/true);
return build2 (TEMPLATE_ID_EXPR, type, templ, arglist);
}

View File

@ -0,0 +1,15 @@
// PR c++/63528
// { dg-do compile { target c++14 } }
template<class...>
struct X
{
constexpr static bool value = true;
};
static_assert(X<int>::value, "");
template <class... Args>
constexpr bool X_v = X<Args...>::value;
static_assert(X_v<int>, "");