Libstdc++: Fixes std::is_scalar for std::meta::info.
`std::is_scalar` now correctly identifies `std::meta::info` as a scalar type, as required by the C++ standard.
std::is_scalar was updated to correctly handle std::meta::info as a scalar type when reflection is enabled (__cpp_impl_reflection >= 202506L). The standard dictates that std::meta::info and its cv-qualified versions are scalar types. This patch adds a check for is_reflection in the implementation of std::is_scalar to align with the standard. A new test was added to verify the fix.
In Details
This commit fixes an oversight in std::is_scalar within libstdc++. According to the C++ standard, std::meta::info should be considered a scalar type. The implementation of std::is_scalar in <type_traits> was missing a check for is_reflection, leading to incorrect results. This commit adds the missing check. The relevant code lives in include/std/type_traits.
For Context
In C++, std::is_scalar is a type trait that checks if a given type is a scalar type (e.g., arithmetic types, pointers, enums). Reflection, a new feature in C++, allows programs to inspect and manipulate types at runtime. std::meta::info is a type used in reflection to represent type information. This commit ensures that std::is_scalar correctly identifies std::meta::info as a scalar type when reflection is enabled, ensuring compliance with the C++ standard and proper behavior of template metaprogramming.