+2014-11-24 Jason Merrill <jason@redhat.com>
+
+ * pt.c (lookup_template_variable): Always unknown_type_node.
+
2014-11-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/63786
return ret;
}
-/* Return a TEMPLATE_ID_EXPR for the given variable template and ARGLIST.
- If the ARGLIST refers to any template parameters, the type of the
- expression is the unknown_type_node since the template-id could
- refer to an explicit or partial specialization. */
+/* Return a TEMPLATE_ID_EXPR for the given variable template and ARGLIST.
+ The type of the expression is the unknown_type_node since the
+ template-id could refer to an explicit or partial specialization. */
tree
lookup_template_variable (tree templ, tree arglist)
{
- tree type;
- if (uses_template_parms (arglist))
- type = unknown_type_node;
- else
- type = TREE_TYPE (templ);
+ tree type = unknown_type_node;
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,
--- /dev/null
+// DR 1727: a specialization doesn't need to have the same type
+// { dg-do compile { target c++14 } }
+
+template <class T> T t = 42;
+template<> void* t<int> = 0;
+
+template<class T, class U> struct same;
+template<class T> struct same<T,T> {};
+same<void*,decltype(t<int>)> s;