c++: P0848R3 and member function templates [PR95181]
authorPatrick Palka <ppalka@redhat.com>
Fri, 22 May 2020 14:28:19 +0000 (10:28 -0400)
committerJason Merrill <jason@redhat.com>
Fri, 29 May 2020 22:18:29 +0000 (18:18 -0400)
commitc75ebe76ae12ac4020f20a24f34606a594a40d15
treedc384665b2d840345b339c600b84a27994d98fc0
parent2fb595f8348e164d2f06536ba98322616eeaeeb6
c++: P0848R3 and member function templates [PR95181]

When comparing two special member function templates to see if one hides
the other (as per P0848R3), we need to check satisfaction which we can't
do on templates.  So this patch makes add_method skip the eligibility
test on member function templates and just lets them coexist.

gcc/cp/ChangeLog:

PR c++/95181
* class.c (add_method): Let special member function templates
coexist if they are not equivalently constrained, or in a class
template.

gcc/testsuite/ChangeLog:

PR c++/95181
* g++.dg/concepts/pr95181.C: New test.
* g++.dg/concepts/pr95181-2.C: New test.

Co-authored-by: Jason Merrill <jason@redhat.com>
gcc/cp/class.c
gcc/testsuite/g++.dg/concepts/pr95181-2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/concepts/pr95181.C [new file with mode: 0644]