diff options
Diffstat (limited to 'gcc/cp/rtti.c')
-rw-r--r-- | gcc/cp/rtti.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index d628862..0be9eff 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -143,16 +143,20 @@ static bool typeinfo_in_lib_p (tree); static int doing_runtime = 0; -static void +static unsigned push_abi_namespace (void) { push_nested_namespace (abi_node); push_visibility ("default", 2); + unsigned flags = module_kind; + module_kind = 0; + return flags; } static void -pop_abi_namespace (void) +pop_abi_namespace (unsigned flags) { + module_kind = flags; pop_visibility (2); pop_nested_namespace (abi_node); } @@ -765,7 +769,7 @@ build_dynamic_cast_1 (location_t loc, tree type, tree expr, dcast_fn = dynamic_cast_node; if (!dcast_fn) { - push_abi_namespace (); + unsigned flags = push_abi_namespace (); tree tinfo_ptr = xref_tag (class_type, get_identifier ("__class_type_info")); tinfo_ptr = cp_build_qualified_type (tinfo_ptr, TYPE_QUAL_CONST); @@ -780,7 +784,7 @@ build_dynamic_cast_1 (location_t loc, tree type, tree expr, NULL_TREE)); dcast_fn = (build_library_fn_ptr (fn_name, fn_type, ECF_LEAF | ECF_PURE | ECF_NOTHROW)); - pop_abi_namespace (); + pop_abi_namespace (flags); dynamic_cast_node = dcast_fn; } result = build_cxx_call (dcast_fn, 4, elems, complain); @@ -954,11 +958,11 @@ tinfo_base_init (tinfo_s *ti, tree target) vtable_ptr = ti->vtable; if (!vtable_ptr) { - push_abi_namespace (); + int flags = push_abi_namespace (); tree real_type = xref_tag (class_type, ti->name); tree real_decl = TYPE_NAME (real_type); DECL_SOURCE_LOCATION (real_decl) = BUILTINS_LOCATION; - pop_abi_namespace (); + pop_abi_namespace (flags); if (!COMPLETE_TYPE_P (real_type)) { |