#include <cstdint>
#include <cstddef>
template<int N> struct Foo {
operator uint16_t() const noexcept requires(N == 2) {
return 0;
}
template<int I = 0, char (*)[(N == 8) || (I & 0)] = nullptr>
operator uint64_t() const noexcept {
return 0;
}
};
int main() {
Foo<2> foo;
std::size_t bar = foo;
return bar;
}
clang emits: error: zero-length arrays are not permitted in C++.
Earlier versions of Clang (up to 21) compiled the same code without issues.
see godbolt