[Bug libstdc++/125024] [reflection] `std::is_scalar_v<std::meta::info>` incorrectly yields `false`
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Apr 27 11:32:22 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125024
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:7f4cc8140e3eae85e77c755fc14991456649af7e
commit r17-101-g7f4cc8140e3eae85e77c755fc14991456649af7e
Author: Jakub Jelinek <jakub@redhat.com>
Date: Mon Apr 27 13:30:58 2026 +0200
libstdc++: Fix up std::is_scalar for std::meta::info [PR125024]
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>
More information about the Gcc-bugs
mailing list