mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 14:59:39 +02:00
https://eel.is/c++draft/basic.types.general#9.sentence-1 says that std::meta::info and its cv-qualified versions are scalar types too (and in https://eel.is/c++draft/basic.fundamental#19.sentence-1 that they are fundamental types too). Now, on the reflection side, eval_is_scalar_type is handled in the compiler and uses SCALAR_TYPE_P (type) which includes REFLECTION_TYPE_P check and eval_is_fundamental_type includes that explicitly too. std::is_fundamental uses template<typename _Tp> struct is_fundamental : public __or_<is_arithmetic<_Tp>, is_void<_Tp>, is_null_pointer<_Tp> #if __cpp_impl_reflection >= 202506L , is_reflection<_Tp> #endif >::type { }; but for std::is_scalar we apparently forgot to include is_reflection. The following patch fixes that. 2026-04-26 Jakub Jelinek <jakub@redhat.com> PR libstdc++/125024 * include/std/type_traits (std::is_scalar): For __cpp_impl_reflection >= 202506L handle is_reflection types as scalar. * testsuite/20_util/is_scalar/reflection.cc: New test. Reviewed-by: Jonathan Wakely <jwakely@redhat.com>