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

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

https://gcc.gnu.org/g:f1933b5ba13bb2abd1329cfb1ba9501c90f4c516

commit r17-3533-gf1933b5ba13bb2abd1329cfb1ba9501c90f4c516
Author: Jason Merrill <[email protected]>
Date:   Fri Aug 21 20:14:25 2026 -0400

    c++: modules vs typeid [PR124888]

    Instantiating a template from a TU which included <typeinfo> in an
importing
    TU which didn't should still work.  Instead of messing with lookup in the
    other TU, let's reuse the type that we already gave the TYPEID_EXPR.

            PR c++/124888

    gcc/cp/ChangeLog:

            * pt.cc (tsubst_expr): Pass type to {get,build}_typeid.
            * rtti.cc (build_typeid, get_typeid): Take it.
            (type_info_ptr_type): Remove.
            (get_tinfo_ptr): Take tinfo_ptr_type instead of voidp.
            (get_tinfo_ptr_dynamic): Likewise.
            (get_void_tinfo_ptr): Pass const_ptr_type_node.
            * cp-tree.h (build_typeid, get_typeid): Adjust.

    gcc/testsuite/ChangeLog:

            * g++.dg/modules/typeid-2_a.C: New test.
            * g++.dg/modules/typeid-2_b.C: New test.

Reply via email to