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

--- Comment #4 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:717d9ab87742577b58188f397f8055bfe72ed6cf

commit r16-8851-g717d9ab87742577b58188f397f8055bfe72ed6cf
Author: Marek Polacek <[email protected]>
Date:   Wed Apr 22 17:17:05 2026 -0400

    c++/reflection: erroneous access check on dependent splice [PR124989]

    When processing &[:R:] in cp_parser_splice_expression, we call
    build_offset_ref with access checking turned off via push_ and
    pop_deferring_access_checks, but the same pair of calls is not
    present around the call to build_offset_ref in tsubst_splice_expr
    and so the following test fails to compile due to access control
    checking failures.

            PR c++/124989

    gcc/cp/ChangeLog:

            * pt.cc (tsubst_splice_expr): Turn off access checking for the
            build_offset_ref call.

    gcc/testsuite/ChangeLog:

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

    Reviewed-by: Patrick Palka <[email protected]>
    (cherry picked from commit 503724ac5ac16f18b5ea27599cb2816ba61ca2af)

Reply via email to