diff options
author | Nathaniel Shead <nathanieloshead@gmail.com> | 2024-08-21 00:42:42 +1000 |
---|---|---|
committer | Nathaniel Shead <nathanieloshead@gmail.com> | 2024-10-25 08:13:21 +1100 |
commit | 6713f05a2aeb852c3f4d738c8c5dbad816624323 (patch) | |
tree | d4b26c18c145df41a3b7776974bbbc4630bc47cc /gcc/cp | |
parent | ca0ab7a0ac18911181e9161cfb8b87fb90039612 (diff) | |
download | gcc-6713f05a2aeb852c3f4d738c8c5dbad816624323.zip gcc-6713f05a2aeb852c3f4d738c8c5dbad816624323.tar.gz gcc-6713f05a2aeb852c3f4d738c8c5dbad816624323.tar.bz2 |
c++: Handle ABI for non-polymorphic dynamic classes
The Itanium ABI has specific rules for when virtual tables for dynamic
classes should be emitted. However we didn't consider structures with
virtual inheritance but no virtual members as dynamic classes for ABI
purposes; this patch fixes this.
gcc/cp/ChangeLog:
* decl2.cc (import_export_class): Use TYPE_CONTAINS_VPTR_P
instead of TYPE_POLYMORPHIC_P.
(import_export_decl): Likewise.
gcc/testsuite/ChangeLog:
* g++.dg/modules/virt-5_a.C: New test.
* g++.dg/modules/virt-5_b.C: New test.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/decl2.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/cp/decl2.cc b/gcc/cp/decl2.cc index a455eb4..fa32ce3 100644 --- a/gcc/cp/decl2.cc +++ b/gcc/cp/decl2.cc @@ -2434,7 +2434,7 @@ import_export_class (tree ctype) translation unit, then export the class; otherwise, import it. */ import_export = -1; - else if (TYPE_POLYMORPHIC_P (ctype)) + else if (TYPE_CONTAINS_VPTR_P (ctype)) { tree cdecl = TYPE_NAME (ctype); if (DECL_LANG_SPECIFIC (cdecl) && DECL_MODULE_ATTACH_P (cdecl)) @@ -3530,7 +3530,7 @@ import_export_decl (tree decl) class_type = type; import_export_class (type); if (CLASSTYPE_INTERFACE_KNOWN (type) - && TYPE_POLYMORPHIC_P (type) + && TYPE_CONTAINS_VPTR_P (type) && CLASSTYPE_INTERFACE_ONLY (type) /* If -fno-rtti was specified, then we cannot be sure that RTTI information will be emitted with the |