https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94819
--- 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:1d2290caad0dba52b285b47057b7c0e4e8d21feb commit r10-8025-g1d2290caad0dba52b285b47057b7c0e4e8d21feb Author: Patrick Palka <ppa...@redhat.com> Date: Tue Apr 28 21:45:59 2020 -0400 c++: Satisfaction caching of inherited ctor [PR94819] As observed in PR94719, an inherited constructor for an instantiation of a constructor template confusingly has as its DECL_INHERITED_CTOR the TEMPLATE_DECL of the constructor template rather than the particular instantiation of the template. This means two inherited constructors for two different instantiations of the same constructor template have the same DECL_INHERITED_CTOR. And since in satisfy_declaration_constraints our decl satisfaction cache is keyed off of the result of strip_inheriting_ctors, we may end up conflating the satisfaction values of the two inherited constructors' constraints. This patch fixes this issue by using the original tree, not the result of strip_inheriting_ctors, as the key to the decl satisfaction cache. gcc/cp/ChangeLog: PR c++/94819 * constraint.cc (satisfy_declaration_constraints): Use saved_t instead of t as the key to decl_satisfied_cache. gcc/testsuite/ChangeLog: PR c++/94819 * g++.dg/cpp2a/concepts-inherit-ctor10.C: New test. * g++.dg/cpp2a/concepts-inherit-ctor11.C: New test.