-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[clang][bytecode] Fix a std::optional<bool> mishap #167091
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) ChangesThis is about the value saved in the std::optional, not about whether the optional has a value at all. Full diff: https://github.com/llvm/llvm-project/pull/167091.diff 1 Files Affected:
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index 84f7e6287609c..d0368feda0052 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include "Compiler.h"
+#include "ByteCode/Interp.h"
#include "ByteCodeEmitter.h"
#include "Context.h"
#include "FixedPoint.h"
@@ -2508,7 +2509,7 @@ bool Compiler<Emitter>::VisitAbstractConditionalOperator(
};
if (std::optional<bool> BoolValue = getBoolValue(Condition)) {
- if (BoolValue)
+ if (*BoolValue)
return visitChildExpr(TrueExpr);
return visitChildExpr(FalseExpr);
}
|
This is about the value saved in the std::optional, not about whether the optional has a value at all.
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/42/builds/6888 Here is the relevant piece of the build log for the reference |
This is about the value saved in the std::optional, not about whether the optional has a value at all.
This is about the value saved in the std::optional, not about whether the optional has a value at all.