]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Check constraints before instantiation from mark_used [PR95132]
authorPatrick Palka <ppalka@redhat.com>
Wed, 28 Oct 2020 15:47:26 +0000 (11:47 -0400)
committerPatrick Palka <ppalka@redhat.com>
Wed, 28 Oct 2020 15:49:15 +0000 (11:49 -0400)
commit833b180f097e8bae44634e6a31e9c92d661af301
tree33ffc598cf0daa199dcc901c82d056b4080f467b
parent4af78dd8c49927ad6c01319e6d6c9aa7b9524b49
c++: Check constraints before instantiation from mark_used [PR95132]

This makes mark_used check constraints of a function _before_ calling
maybe_instantiate_decl, so that we don't try instantiating a function
(as part of return type deduction) with unsatisfied constraints.

gcc/cp/ChangeLog:

PR c++/95132
* decl2.c (mark_used): Move up the constraints_satisfied_p check
so that we check constraints before calling maybe_instantiate_decl.

gcc/testsuite/ChangeLog:

PR c++/95132
* g++.dg/cpp2a/concepts-fn7.C: New test.

(cherry picked from commit 9ccc3495766116ea4ae8e4cd8129beca60e30445)
gcc/cp/decl2.c
gcc/testsuite/g++.dg/cpp2a/concepts-fn7.C [new file with mode: 0644]