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

--- Comment #1 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:e797f09f8bdd680620da04d925ee429ed3201e07

commit r17-1862-ge797f09f8bdd680620da04d925ee429ed3201e07
Author: Marek Polacek <[email protected]>
Date:   Wed Jun 24 15:59:28 2026 -0400

    c++/reflection: ^^ cannot define types [PR125922]

    The reflect-expression production uses "^^ type-id" which doesn't
    allow defining types (it's not defining-type-id), but we aren't
    checking this.

            PR c++/125922

    gcc/cp/ChangeLog:

            * parser.cc (cp_parser_reflect_expression): Temporarily set
            parser->type_definition_forbidden_message.

    gcc/testsuite/ChangeLog:

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

    Reviewed-by: Jason Merrill <[email protected]>

Reply via email to