[clang] [Clang] Handle ?: operator in fold expression (PR #164019)
Azmat Yusuf via cfe-commits
cfe-commits at lists.llvm.org
Sat Apr 11 11:53:23 PDT 2026
================
@@ -1510,7 +1510,7 @@ static void CheckFoldOperand(Sema &S, Expr *E) {
E = E->IgnoreImpCasts();
auto *OCE = dyn_cast<CXXOperatorCallExpr>(E);
if ((OCE && OCE->isInfixBinaryOp()) || isa<BinaryOperator>(E) ||
- isa<AbstractConditionalOperator>(E)) {
+ isa<AbstractConditionalOperator>(E) || isa<RecoveryExpr>(E)) {
----------------
azmat-y wrote:
Yeah it no longer looks like a good idea to me either.
Instead of making any changes here instead maybe we can change `Sema::ActOnConditionalOp`. After checking for absence of `LHSExpr` we can check if our `CondExpr` contains Unexpanded parameter pack. If it does we don't lower otherwise we do.
Thoughts?
https://github.com/llvm/llvm-project/pull/164019
More information about the cfe-commits
mailing list