commit 7e029731a4b77a1c54982e9922ff09219c46cc4b
Author: Jason Merrill <jason@redhat.com>
Date: Wed Oct 15 13:20:58 2014 -0400
PR c++/63528
* pt.c (lookup_template_variable): Call coerce_template_parms.
@@ -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);
}
new file mode 100644
@@ -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>, "");