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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <[email protected]>:

https://gcc.gnu.org/g:6f12a4a8d4e62d82d6f8fd79ff4dffe30f387c4d

commit r16-8535-g6f12a4a8d4e62d82d6f8fd79ff4dffe30f387c4d
Author: Marek Polacek <[email protected]>
Date:   Tue Mar 31 16:52:10 2026 -0400

    c++/reflection: spurious error with constrained return types [PR124457]

    Here we are emitting a bogus error in get_reflection because it
    got something for which is_auto was true: the constrained auto
    coming from make_constrained_auto.  We represent the
    return-type-requirement as a constrained auto which is in fact
    a placeholder, but in this case we don't want the error.

    We can move the error from get_reflection to the parser to avoid
    emitting the error.

            PR c++/124457

    gcc/cp/ChangeLog:

            * parser.cc (cp_parser_reflect_expression): Check is_auto here
            instead of...
            * reflect.cc (get_reflection): ...here.

    gcc/testsuite/ChangeLog:

            * g++.dg/reflect/concept1.C: New test.

    Reviewed-by: Patrick Palka <[email protected]>

Reply via email to