c++: Stream virtual dtor vtable indices
commit14979dd31c887ba5ba573f2cdb0647b37e09641a
authorNathaniel Shead <nathanieloshead@gmail.com>
Tue, 14 Nov 2023 16:26:03 +0000 (14 11:26 -0500)
committerNathan Sidwell <nathan@acm.org>
Tue, 14 Nov 2023 19:43:20 +0000 (14 14:43 -0500)
treea81f5bf5a6adb8b356d5d81efa8cfad3ffc39701
parent5b9ecce87e8f315e2681743d75401991cdfefa71
c++: Stream virtual dtor vtable indices

Virtual cloned functions have distinct vtable indices, stream them
explicitly.

As such, this patch ensures that DECL_VINDEX is properly passed on for
cloned functions as well to prevent this from causing issues.

PR c++/103499

gcc/cp/ChangeLog:

* module.cc (trees_out::decl_node): Write DECL_VINDEX for
virtual clones.
(trees_in::tree_node): Read DECL_VINDEX for virtual clones.

gcc/testsuite/ChangeLog:

* g++.dg/modules/pr103499_a.C: New test.
* g++.dg/modules/pr103499_b.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Signed-off-by: Nathan Sidwell <nathan@acm.org>
gcc/cp/module.cc
gcc/testsuite/g++.dg/modules/pr103499_a.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/pr103499_b.C [new file with mode: 0644]