Message ID | 20240614145628.1366316-1-jwakely@redhat.com |
---|---|
State | New |
Headers | show |
Series | [committed] libstdc++: Make std::type_info::operator== always_inline for C++23 [PR110572] | expand |
diff --git a/libstdc++-v3/libsupc++/typeinfo b/libstdc++-v3/libsupc++/typeinfo index fcc3077d060..35e72bb18ee 100644 --- a/libstdc++-v3/libsupc++/typeinfo +++ b/libstdc++-v3/libsupc++/typeinfo @@ -188,6 +188,9 @@ namespace std #endif #if __GXX_TYPEINFO_EQUALITY_INLINE || __cplusplus > 202002L +# if ! __GXX_TYPEINFO_EQUALITY_INLINE + [[__gnu__::__always_inline__]] +# endif _GLIBCXX23_CONSTEXPR inline bool type_info::operator==(const type_info& __arg) const _GLIBCXX_NOEXCEPT { diff --git a/libstdc++-v3/testsuite/18_support/type_info/110572.cc b/libstdc++-v3/testsuite/18_support/type_info/110572.cc new file mode 100644 index 00000000000..64081879b77 --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/type_info/110572.cc @@ -0,0 +1,11 @@ +// { dg-options "-static-libstdc++" } +// { dg-require-static-libstdcxx } +// { dg-require-cpp-feature-test __cpp_rtti } +// { dg-do link } + +#include <typeinfo> + +int main() +{ + return typeid(0) == typeid(0u); +}