c++: constraints and address of template-id
authorPatrick Palka <ppalka@redhat.com>
Mon, 10 Aug 2020 13:33:17 +0000 (09:33 -0400)
committerPatrick Palka <ppalka@redhat.com>
Mon, 10 Aug 2020 13:33:17 +0000 (09:33 -0400)
commit41fd9d26108fc98bbffce3d99d218a6a09fa80c6
tree8d896c17924343c311a31c605a5ff82c0a2b57d9
parent90f7636bf8df50940e0f749af60a6b374a8f09b4
c++: constraints and address of template-id

When resolving the address of a template-id, we need to drop functions
whose associated constraints are not satisfied, as per [over.over].  We
do so in resolve_address_of_overloaded_function, but not in
resolve_overloaded_unification or resolve_nondeduced_context, which
seems like an oversight.

gcc/cp/ChangeLog:

* pt.c (resolve_overloaded_unification): Drop functions with
unsatisfied constraints.
(resolve_nondeduced_context): Likewise.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/concepts-fn5.C: New test.
* g++.dg/concepts/fn8.C: Generalize dg-error directive to accept
"no matching function ..." diagnostic.
* g++.dg/cpp2a/concepts-fn1.C: Likewise.
* g++.dg/cpp2a/concepts-ts2.C: Likewise.
* g++.dg/cpp2a/concepts-ts3.C: Likewise.
gcc/cp/pt.c
gcc/testsuite/g++.dg/concepts/fn8.C
gcc/testsuite/g++.dg/cpp2a/concepts-fn1.C
gcc/testsuite/g++.dg/cpp2a/concepts-fn5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/concepts-ts2.C
gcc/testsuite/g++.dg/cpp2a/concepts-ts3.C