]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Handle ABI for non-polymorphic dynamic classes
authorNathaniel Shead <nathanieloshead@gmail.com>
Tue, 20 Aug 2024 14:42:42 +0000 (00:42 +1000)
committerNathaniel Shead <nathanieloshead@gmail.com>
Thu, 24 Oct 2024 21:13:21 +0000 (08:13 +1100)
commit6713f05a2aeb852c3f4d738c8c5dbad816624323
treed4b26c18c145df41a3b7776974bbbc4630bc47cc
parentca0ab7a0ac18911181e9161cfb8b87fb90039612
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>
gcc/cp/decl2.cc
gcc/testsuite/g++.dg/modules/virt-5_a.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/virt-5_b.C [new file with mode: 0644]