Clang now incorrectly allowed increment of bool in unevaluated contexts, we set diagnostic::ext_increment_bool to be SFINAEFailure to fix this issue.
template<class T> auto f(T t) -> decltype(++t); auto f(...) -> void; void g() { f(true); // Clang wrongly makes this a hard error }
template <class T> concept can_increment = requires(T t) { ++t; }; template <class T> void f() { static_assert(requires(T t) { ++t; }); // Incorrectly allowed } int main() { f<bool>(); static_assert(!can_increment<bool>); // Incorrectly fails bool b = false; ++b; // Correctly rejected }
Fix issue: https://github.com/llvm/llvm-project/issues/47517