https://github.com/zeyi2 commented:
I also found an invalid fixit:
Repro:
```cpp
namespace std {
constexpr bool is_constant_evaluated() noexcept {
return __builtin_is_constant_evaluated();
}
}
bool runtime_predicate();
int outer_else_if() {
if (std::is_constant_evaluated())
return 1;
else if (runtime_predicate())
return 2;
return 0;
}
```
The check would modify it to:
```cpp
int outer_else_if() {
if consteval {
return 1;
} else if (runtime_predicate())
return 2;
return 0;
}
```
and `clang++ -std=c++23 -fsyntax-only` gives an compile error.
https://github.com/llvm/llvm-project/pull/189743
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits