https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127987
Bug ID: 127987
Summary: [reflection] Auto type deduction on ill-formed
reflection: Should that compile ?
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: songb432 at gmail dot com
Target Milestone: ---
Link: https://godbolt.org/z/jxdxGejq7
``
template <class T>
struct S { static constexpr auto refl = ^^typename T::type; };
S<int> s; // Clang (reflection) errors. GCC compiles.
template <class T> concept C = requires { S<T>::refl; };
static_assert(C<int> || !C<int>); // Clang (reflection) errors. GCC compiles
(and thinks that `C<int>` is true).
``
I think there's a bug in GCC shown here: it doesn't error correctly.
`C<int>` evaluation itself should trigger a hard error.