@@ -1318,15 +1318,6 @@ bool Compiler<Emitter>::VisitArraySubscriptExpr(const ArraySubscriptExpr *E) {
13181318template <class Emitter >
13191319bool Compiler<Emitter>::visitInitList(ArrayRef<const Expr *> Inits,
13201320 const Expr *ArrayFiller, const Expr *E) {
1321-
1322- QualType QT = E->getType ();
1323-
1324- if (const auto *AT = QT->getAs <AtomicType>())
1325- QT = AT->getValueType ();
1326-
1327- if (QT->isVoidType ())
1328- return this ->emitInvalid (E);
1329-
13301321 // Handle discarding first.
13311322 if (DiscardResult) {
13321323 for (const Expr *Init : Inits) {
@@ -1336,6 +1327,13 @@ bool Compiler<Emitter>::visitInitList(ArrayRef<const Expr *> Inits,
13361327 return true ;
13371328 }
13381329
1330+ QualType QT = E->getType ();
1331+ if (const auto *AT = QT->getAs <AtomicType>())
1332+ QT = AT->getValueType ();
1333+
1334+ if (QT->isVoidType ())
1335+ return this ->emitInvalid (E);
1336+
13391337 // Primitive values.
13401338 if (std::optional<PrimType> T = classify (QT)) {
13411339 assert (!DiscardResult);
@@ -3251,12 +3249,9 @@ template <class Emitter> bool Compiler<Emitter>::visit(const Expr *E) {
32513249 if (E->getType ().isNull ())
32523250 return false ;
32533251
3254- if (E->getType ()->isVoidType ())
3255- return this ->discard (E);
3256-
32573252 // Create local variable to hold the return value.
3258- if (!E->isGLValue () && !E->getType ()-> isAnyComplexType () &&
3259- !classify (E->getType ())) {
3253+ if (!E->getType ()-> isVoidType () && !E->isGLValue () &&
3254+ !E-> getType ()-> isAnyComplexType () && ! classify (E->getType ())) {
32603255 std::optional<unsigned > LocalIndex = allocateLocal (E);
32613256 if (!LocalIndex)
32623257 return false ;
0 commit comments