From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6FD073857809; Wed, 15 Sep 2021 04:27:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6FD073857809 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/48396] std::type_info is implicitly declared Date: Wed, 15 Sep 2021 04:27:45 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.7.0 X-Bugzilla-Keywords: accepts-invalid, rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 04:27:45 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D48396 --- Comment #5 from CVS Commits --- The master branch has been updated by Jason Merrill : https://gcc.gnu.org/g:a53781c8fd258608780821168a7f5faf7be63690 commit r12-3538-ga53781c8fd258608780821168a7f5faf7be63690 Author: Jason Merrill Date: Tue Sep 14 17:37:27 2021 -0400 c++: don't predeclare std::type_info [PR48396] We've always predeclared std::type_info, which has been wrong for a whi= le, 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 typ= es. PR c++/48396 gcc/cp/ChangeLog: * cp-tree.h (enum cp_tree_index): Remove CPTI_TYPE_INFO_PTR_TYP= E. (type_info_ptr_type): Remove. * rtti.c (init_rtti_processing): Don't predeclare std::type_inf= o. (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 the= m. (get_tinfo_desc): Use const_ptr_type_node. gcc/testsuite/ChangeLog: * g++.dg/rtti/undeclared1.C: New test.=