diff options
author | Jason Merrill <jason@redhat.com> | 2021-09-14 17:37:27 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2021-09-15 00:05:40 -0400 |
commit | a53781c8fd258608780821168a7f5faf7be63690 (patch) | |
tree | 3fb316813b7995e18206562e648e5a492667f712 /contrib | |
parent | ba9b07d0259b38a9eccd4eb0df327d3aaabad3c6 (diff) | |
download | gcc-a53781c8fd258608780821168a7f5faf7be63690.zip gcc-a53781c8fd258608780821168a7f5faf7be63690.tar.gz gcc-a53781c8fd258608780821168a7f5faf7be63690.tar.bz2 |
c++: don't predeclare std::type_info [PR48396]
We've always predeclared std::type_info, which has been wrong for a while,
but now with modules it becomes more of a practical problem, if we want to
declare it in the purview of a module. So don't predeclare it. For
building up the type_info information to write out with the vtable, we can
use void* instead of type_info*, since they already aren't the real types.
PR c++/48396
gcc/cp/ChangeLog:
* cp-tree.h (enum cp_tree_index): Remove CPTI_TYPE_INFO_PTR_TYPE.
(type_info_ptr_type): Remove.
* rtti.c (init_rtti_processing): Don't predeclare std::type_info.
(typeid_ok_p): Check for null const_type_info_type_node.
(type_info_ptr_type, get_void_tinfo_ptr): New fns.
(get_tinfo_decl_dynamic, get_tinfo_ptr): Use them.
(ptr_initializer, ptm_initializer, get_pseudo_ti_init): Use them.
(get_tinfo_desc): Use const_ptr_type_node.
gcc/testsuite/ChangeLog:
* g++.dg/rtti/undeclared1.C: New test.
Diffstat (limited to 'contrib')
0 files changed, 0 insertions, 0 deletions