c++: deducing from class type of NTTP [PR105110]
Here when attempting to deduce T in the NTTP type A<T> from the argument
type 'const A<int>', we give up due to the const:
types ‘A<T>’ and ‘const A<int>’ have incompatible cv-qualifiers
But since the type of an NTTP cannot be cv-qualified, it seems natural
to ignore cv-qualifiers on the argument type before attempting to unify
the two types.
PR c++/105110
gcc/cp/ChangeLog:
* pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Drop cv-quals from
the argument type of an NTTP before deducing from it.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/nontype-class52.C: New test.