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

--- Comment #29 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:abab79397ef97acf7c689c43e27d58d8d7d5c599

commit r16-479-gabab79397ef97acf7c689c43e27d58d8d7d5c599
Author: Jason Merrill <ja...@redhat.com>
Date:   Sat May 3 09:30:01 2025 -0400

    c++: adjust PR99599/CWG2369 workaround

    This tweak to CWG2369 has gotten more discussion lately in CWG, including
in
    P3606.  In those discussions, it occurred to me that having the check
depend
    on whether a class has been instantiated yet is unstable, that it should
    only check for user-defined conversions.

    Also, one commenter was surprised that adding an explicitly-declared
default
    constructor to a class changed things, so this patch also changes the
    aggregate check to more narrowly checking for one-argument constructors
    other than the copy/move constructors.

    As a result, this early filter resembles how LOOKUP_DEFAULTED rejects any
    candidate that would need a UDC: in both cases we want to avoid considering
    arbitrary UDCs.  But here, rather than rejecting, we want the early filter
    to let the candidate past without considering the conversion.

            PR c++/99599

    gcc/cp/ChangeLog:

            * cp-tree.h (type_has_converting_constructor): Declare.
            * class.cc (type_has_converting_constructor): New.
            * pt.cc (conversion_may_instantiate_p): Don't check completeness.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/concepts-recursive-sat4.C: Adjust again.
            * g++.dg/cpp2a/concepts-nondep5.C: New test.

Reply via email to