================
@@ -4247,6 +4247,13 @@ FieldDecl *Expr::getSourceBitField() {
if (UnOp->isPrefix() && UnOp->isIncrementDecrementOp())
return UnOp->getSubExpr()->getSourceBitField();
+ if (const ConditionalOperator *Cond = dyn_cast<ConditionalOperator>(E)) {
+ if (FieldDecl *FD = Cond->getTrueExpr()->getSourceBitField())
+ return FD;
+ if (FieldDecl *FD = Cond->getFalseExpr()->getSourceBitField())
+ return FD;
+ }
----------------
MitchBriles wrote:
I think if the operands differ in that way, it's handled in
`Sema::CXXCheckConditionalOperands`. If folks can agree on the expected
behavior, I'll make sure my patch is correct before marking it as ready.
https://github.com/llvm/llvm-project/pull/169480
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits