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

--- 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:a049fa78a5f5da3f8789d8097ca8a9b69dcea9c6

commit r16-9130-ga049fa78a5f5da3f8789d8097ca8a9b69dcea9c6
Author: Marek Polacek <[email protected]>
Date:   Fri Jun 12 11:44:15 2026 -0400

    c++/reflection: ICE in get_reflection on INDIRECT_REF [PR125759]

    We crash here in outer_var_p on:

      /* These should have been stripped or otherwise handled by the caller. 
*/
      gcc_checking_assert (!REFERENCE_REF_P (decl));

    because we never stripped the INDIRECT_REF in get_reflection.  I don't
    think stripping it only for the outer_automatic_var_p call would be
    right so I'm doing it at the top of the function.

            PR c++/125759

    gcc/cp/ChangeLog:

            * reflect.cc (get_reflection): Do STRIP_REFERENCE_REF.

    gcc/testsuite/ChangeLog:

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

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

Reply via email to