[PATCH] D134801: [clang][Interp] Implement ConditionalOperators
Timm Bäder via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 30 00:36:05 PDT 2022
tbaeder added inline comments.
================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.h:90
bool VisitOpaqueValueExpr(const OpaqueValueExpr *E);
+ bool VisitConditionalOperator(const ConditionalOperator *E);
----------------
aaron.ballman wrote:
> Do we want to handle `BinaryConditionalOperator` at the same time? (IIRC, you should be able to use `AbstractConditionalOperator` here and the logic is handled for you automagically for both constructs.) e.g.,
> ```
> foo() ? 12 : bar // C conditional operator, has the value 12 if foo() is nonzero and bar otherwise
> foo() ? : bar // GNU "missing middle" conditional operator, has the value of foo() if nonzero and bar otherwise
> ```
Yep, that just worked
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134801/new/
https://reviews.llvm.org/D134801
More information about the cfe-commits
mailing list