https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95132
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:9ccc3495766116ea4ae8e4cd8129beca60e30445 commit r11-4488-g9ccc3495766116ea4ae8e4cd8129beca60e30445 Author: Patrick Palka <ppa...@redhat.com> Date: Wed Oct 28 11:47:26 2020 -0400 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.