the crazy comma expression so that we get an r-value in the
varargs position.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138638
91177308-0d34-0410-b5e6-
96231b3b80d8
ExprResult Comma = ActOnBinOp(TUScope, E->getLocStart(), tok::comma,
Call.get(), E);
if (Comma.isInvalid())
- return ExprError();
-
+ return ExprError();
E = Comma.get();
+
+ // Use that to initialize a temporary, or else we might get an
+ // l-value in a varargs position.
+ ExprResult Temp = PerformCopyInitialization(
+ InitializedEntity::InitializeTemporary(E->getType()),
+ E->getLocStart(),
+ Owned(E));
+ if (Temp.isInvalid())
+ return ExprError();
+ E = Temp.get();
}
}