================
@@ -4522,6 +4523,38 @@ static CompleteObject findCompleteObject(EvalInfo &Info, 
const Expr *E,
 
         BaseVal = MTE->getOrCreateValue(false);
         assert(BaseVal && "got reference to unevaluated temporary");
+      } else if (const CompoundLiteralExpr *CLE =
+                     dyn_cast_or_null<CompoundLiteralExpr>(Base)) {
+        // In C99, a CompoundLiteralExpr is an lvalue, and we defer evaluating
+        // the initializer until now for such expressions. Such an expression
+        // can't be an ICE in C, so this only matters for fold.
+        if (LValType.isVolatileQualified()) {
----------------
efriedma-quic wrote:

Checking for volatile is redundant, I think?  I see there's earlier code in 
this function which checks for volatile.

https://github.com/llvm/llvm-project/pull/137163
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to