Код: Выделить всё
template
struct S {
enum : bool { b = sizeof(S) > 32 };
void f() requires(b) { }
};
< /code>
Clang с радостью принимает этот код, в то время как GCC не удается с: < /p>
error: constraint expression does not have type 'bool' [-Wtemplate-body]
4 | void f() requires(b) { }
| ~^~
Подробнее здесь: https://stackoverflow.com/questions/795 ... c-vs-clang
Мобильная версия