================
@@ -4368,8 +4363,19 @@ template <class Emitter> bool
Compiler<Emitter>::visitIfStmt(const IfStmt *IS) {
if (!visitDeclStmt(CondDecl))
return false;
- if (!this->visitBool(IS->getCond()))
- return false;
+ // Compile condition.
+ if (IS->isNonNegatedConsteval()) {
+ if (!this->emitIsConstantContext(IS))
+ return false;
+ } else if (IS->isNegatedConsteval()) {
+ if (!this->emitIsConstantContext(IS))
+ return false;
+ if (!this->emitInv(IS))
+ return false;
+ } else {
+ if (!this->visitBool(IS->getCond()))
+ return false;
+ }
----------------
cor3ntin wrote:
How would you deal with code like
```cpp
constexpr void f() {
if !consteval {
goto a;
a:;
}
}```
https://github.com/llvm/llvm-project/pull/104707
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits