c++: improve specialization mismatch diagnostic [PR94529]
authorJason Merrill <jason@redhat.com>
Thu, 8 Apr 2021 05:03:28 +0000 (01:03 -0400)
committerJason Merrill <jason@redhat.com>
Thu, 8 Apr 2021 11:58:40 +0000 (07:58 -0400)
commitac24fa46e449fbff0ff571951cfcc78b8488f6e7
treedd9ddd62074c1c4746200d8dd58a3ffe66292122
parent2cd5333d16419f596d07a830bb3f1c40fa8a7b5c
c++: improve specialization mismatch diagnostic [PR94529]

We were telling users they needed more template<> to specialize a member
template in a testcase with no member templates.  Only produce that message
if we actually see a member template, and also always print the candidates.

gcc/cp/ChangeLog:

PR c++/94529
* pt.c (determine_specialization): Improve diagnostic.

gcc/testsuite/ChangeLog:

PR c++/94529
* g++.dg/template/mem-spec2.C: New test.
gcc/cp/pt.c
gcc/testsuite/g++.dg/template/mem-spec2.C [new file with mode: 0644]