Hi,
On 08/15/2014 07:30 PM, Jason Merrill wrote:
On 08/15/2014 12:17 PM, Paolo Carlini wrote:
By the way, more generally, I don't understand at the moment how we can
safely use complete_type in the middle of tsubst & co: it can emit hard
errors about, eg, incompleteness (see c++/62072) irrespective of the
tsubst_flags_t argument...
Yes, it can, that's part of the language; remember "Only invalid types
and expressions in the immediate context of the function type and its
template parameter types can result in a deduction failure", invalid
constructs outside that context result in hard errors.
I see, it boils down again to that "famous" wording...
Now, is it possible that the issue we are facing with implementing DR
1584 has to do with the fact that our unify doesn't tell template
functions vs template classes?!? Thus we should return 1 from
check_cv_quals_for_unify when arg is a FUNCTION_TYPE *and*
DECL_TYPE_TEMPLATE_P (TREE_TYPE (tparms)) is true?!? (we could pass the
information in a flag)
Because I don't think an equivalent of the key bits of c++/62072:
template<typename T> struct tuple_size { };
template<typename T> struct tuple_size<const T> : tuple_size<T> { };
can be constructed for template functions?!?
Paolo.