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

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

https://gcc.gnu.org/g:269a933b80d3b5c716ef1fa83f4f938077dd5da8

commit r16-9165-g269a933b80d3b5c716ef1fa83f4f938077dd5da8
Author: Marek Polacek <[email protected]>
Date:   Wed Jun 24 13:35:14 2026 -0400

    c++/reflection: type traits and reference collapsing [PR125939]

    This PR shows that some of our meta type traits don't work with
    references: we emit bogus

      error: 'const' qualifiers cannot be applied to 'int&'

    errors.  The problem is that build_stub_type is trying to add
    const to a reference, which you can only do through a typedef,
    but here we don't have a typedef.

    Resolved by passing tf_ignore_bad_quals to cp_build_qualified_type.

            PR c++/125939

    gcc/cp/ChangeLog:

            * method.cc (build_stub_type): Pass tf_ignore_bad_quals to
            cp_build_qualified_type.

    gcc/testsuite/ChangeLog:

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

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

Reply via email to