@@ -401,6 +401,17 @@ bool ByteCodeExprGen<Emitter>::VisitBinaryOperator(const BinaryOperator *BO) {
401
401
const Expr *LHS = BO->getLHS ();
402
402
const Expr *RHS = BO->getRHS ();
403
403
404
+ // Handle comma operators. Just discard the LHS
405
+ // and delegate to RHS.
406
+ if (BO->isCommaOp ()) {
407
+ if (!this ->discard (LHS))
408
+ return false ;
409
+ if (RHS->getType ()->isVoidType ())
410
+ return this ->discard (RHS);
411
+
412
+ return this ->delegate (RHS);
413
+ }
414
+
404
415
if (BO->getType ()->isAnyComplexType ())
405
416
return this ->VisitComplexBinOp (BO);
406
417
if ((LHS->getType ()->isAnyComplexType () ||
@@ -416,16 +427,6 @@ bool ByteCodeExprGen<Emitter>::VisitBinaryOperator(const BinaryOperator *BO) {
416
427
std::optional<PrimType> RT = classify (RHS->getType ());
417
428
std::optional<PrimType> T = classify (BO->getType ());
418
429
419
- // Deal with operations which have composite or void types.
420
- if (BO->isCommaOp ()) {
421
- if (!this ->discard (LHS))
422
- return false ;
423
- if (RHS->getType ()->isVoidType ())
424
- return this ->discard (RHS);
425
-
426
- return this ->delegate (RHS);
427
- }
428
-
429
430
// Special case for C++'s three-way/spaceship operator <=>, which
430
431
// returns a std::{strong,weak,partial}_ordering (which is a class, so doesn't
431
432
// have a PrimType).
0 commit comments