Skip to content

Commit 1ebcbfc

Browse files
committed
[clang][bytecode] Fix a std::optional<bool> mishap
This is about the value saved in the std::optional, not about whether the optional has a value at all.
1 parent 9b114c5 commit 1ebcbfc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/lib/AST/ByteCode/Compiler.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "Compiler.h"
10+
#include "ByteCode/Interp.h"
1011
#include "ByteCodeEmitter.h"
1112
#include "Context.h"
1213
#include "FixedPoint.h"
@@ -2508,7 +2509,7 @@ bool Compiler<Emitter>::VisitAbstractConditionalOperator(
25082509
};
25092510

25102511
if (std::optional<bool> BoolValue = getBoolValue(Condition)) {
2511-
if (BoolValue)
2512+
if (*BoolValue)
25122513
return visitChildExpr(TrueExpr);
25132514
return visitChildExpr(FalseExpr);
25142515
}

0 commit comments

Comments
 (0)