mirror of git://gcc.gnu.org/git/gcc.git
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:
parent
48fb6d4090
commit
a0272f8660
|
|
@ -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>
|
2014-10-15 Paolo Carlini <paolo.carlini@oracle.com>
|
||||||
|
|
||||||
* semantics.c (is_instantiation_of_constexpr, literal_type_p,
|
* semantics.c (is_instantiation_of_constexpr, literal_type_p,
|
||||||
|
|
|
||||||
|
|
@ -7993,6 +7993,10 @@ lookup_template_variable (tree templ, tree arglist)
|
||||||
type = unknown_type_node;
|
type = unknown_type_node;
|
||||||
else
|
else
|
||||||
type = TREE_TYPE (templ);
|
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);
|
return build2 (TEMPLATE_ID_EXPR, type, templ, arglist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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>, "");
|
||||||
Loading…
Reference in New Issue