[Bug c++/111890] ICE in tsubst_friend_function with friend function declared inside a concept constrainted class inside a template class

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jul 17 15:08:56 GMT 2024


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111890

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:247335823f420eb1dd56f4bf32ac78d441f5ccc2

commit r15-2098-g247335823f420eb1dd56f4bf32ac78d441f5ccc2
Author: Patrick Palka <ppalka@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 <jason@redhat.com>


More information about the Gcc-bugs mailing list