]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Make std::type_info::operator== always_inline for C++23 [PR110572]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 11 Jun 2024 14:52:30 +0000 (15:52 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 14 Jun 2024 14:24:14 +0000 (15:24 +0100)
commit6af8d8e618ed27dae3432c96484de4360bd893ab
treed20a08a70c304bee0caef69217e9404c72524200
parent161efd677458f20d13ee1018a4d5e3964febd508
libstdc++: Make std::type_info::operator== always_inline for C++23 [PR110572]

Commit r12-6266-g3633cc54284450 implemented P1328 for C++23, making
std::type_info::operator== usable in constant expressions. For targets
such as mingw-w64 where that function was not previously inline, making
it constexpr required making it inline for C++23 and later. For
statically linked programs this can result in multiple definition
errors, because there's a non-inline definition in libstdc++.a as well.

For those targets make it always_inline for C++23, so that there is no
symbol generated for the inline definition, and the non-inline
definition in libstdc++.a will be the only definition.

libstdc++-v3/ChangeLog:

PR libstdc++/110572
* libsupc++/typeinfo (type_info::operator==): Add always_inline
attribute for targets where the ABI requries equality to be
non-inline.
* testsuite/18_support/type_info/110572.cc: New test.
libstdc++-v3/libsupc++/typeinfo
libstdc++-v3/testsuite/18_support/type_info/110572.cc [new file with mode: 0644]
This page took 0.05898 seconds and 6 git commands to generate.