Commit ec529e25 by Jason Merrill Committed by Jason Merrill

* pt.c (lookup_template_variable): Always unknown_type_node.

From-SVN: r218045
parent 191ec640
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> 2014-11-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/63786 PR c++/63786
......
...@@ -8026,19 +8026,14 @@ lookup_template_class (tree d1, tree arglist, tree in_decl, tree context, ...@@ -8026,19 +8026,14 @@ lookup_template_class (tree d1, tree arglist, tree in_decl, tree context,
return ret; return ret;
} }
/* Return a TEMPLATE_ID_EXPR for the given variable template and ARGLIST. /* Return a TEMPLATE_ID_EXPR for the given variable template and ARGLIST.
If the ARGLIST refers to any template parameters, the type of the The type of the expression is the unknown_type_node since the
expression is the unknown_type_node since the template-id could template-id could refer to an explicit or partial specialization. */
refer to an explicit or partial specialization. */
tree tree
lookup_template_variable (tree templ, tree arglist) lookup_template_variable (tree templ, tree arglist)
{ {
tree type; tree type = unknown_type_node;
if (uses_template_parms (arglist))
type = unknown_type_node;
else
type = TREE_TYPE (templ);
tsubst_flags_t complain = tf_warning_or_error; tsubst_flags_t complain = tf_warning_or_error;
tree parms = INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (templ)); tree parms = INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (templ));
arglist = coerce_template_parms (parms, arglist, templ, complain, arglist = coerce_template_parms (parms, arglist, templ, complain,
......
// 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;
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