]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: constraints and address of template-id
authorPatrick Palka <ppalka@redhat.com>
Mon, 10 Aug 2020 13:39:29 +0000 (09:39 -0400)
committerPatrick Palka <ppalka@redhat.com>
Thu, 13 Aug 2020 15:55:02 +0000 (11:55 -0400)
commit8679d8886383d77e3cc5b79b861b046e11f66a37
tree3c5ed2c7b13691742b0e92f26c21d8734118f6e4
parent83a53af3c77e32d692accc0da1f2b021d25613b4
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.

(cherry picked from commit 41fd9d26108fc98bbffce3d99d218a6a09fa80c6)
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