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:47:26 +0000 (11:47 -0400)
commit9ccc3495766116ea4ae8e4cd8129beca60e30445
tree622bad79f4db558f58a19afcb464d5fa90c51590
parent7d5f38e49e59a09140473aa592133360428a1d83
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.
gcc/cp/decl2.c
gcc/testsuite/g++.dg/cpp2a/concepts-fn7.C [new file with mode: 0644]