https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127252
Bug ID: 127252
Summary: ``^^__remove_cv(const int)`` doesn't compile. Should
it be invalid?
Product: gcc
Version: 16.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: songb432 at gmail dot com
Target Milestone: ---
https://godbolt.org/z/j95jvajar
#include <meta>
constexpr auto x = ^^__remove_cv(const int); // ok in Clang. error in GCC:
'__remove_cv' has not been declared.
using type = __remove_cv(const int); // ok
constexpr auto y = ^^type;
constexpr auto z = ^^decltype(static_cast<__remove_cv(const int)>(3)); // ok
static_assert(std::meta::is_same_type(x, ^^int)); // passed in Clang
static_assert(std::meta::is_same_type(y, ^^int)); // passed
static_assert(std::meta::is_same_type(z, ^^int)); // passed
If GCC doesn't want to support reflections to types from directly builtin
traits, then GCC should error correctly.
If GCC want to support reflections to types from builtin traits, then the code
should compile.