https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111890
--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:1bbfe788d1a76979e5be14169248bc34106e9c03 commit r14-10451-g1bbfe788d1a76979e5be14169248bc34106e9c03 Author: Patrick Palka <ppa...@redhat.com> Date: Wed Jul 17 11:08:35 2024 -0400 c++: constrained partial spec type context [PR111890] maybe_new_partial_specialization wasn't propagating TYPE_CONTEXT when creating a new class type corresponding to a constrained partial spec, which do_friend relies on via template_class_depth to distinguish a template friend from a non-template friend, and so in the below testcase we were incorrectly instantiating the non-template operator+ as if it were a template leading to an ICE. PR c++/111890 gcc/cp/ChangeLog: * pt.cc (maybe_new_partial_specialization): Propagate TYPE_CONTEXT to the newly created partial specialization. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-partial-spec15.C: New test. Reviewed-by: Jason Merrill <ja...@redhat.com> (cherry picked from commit 247335823f420eb1dd56f4bf32ac78d441f5ccc2)