File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -3341,7 +3341,8 @@ bool ByteCodeExprGen<Emitter>::VisitCallExpr(const CallExpr *E) {
3341
3341
// write the result into.
3342
3342
if (IsVirtual && !HasQualifier) {
3343
3343
uint32_t VarArgSize = 0 ;
3344
- unsigned NumParams = Func->getNumWrittenParams ();
3344
+ unsigned NumParams =
3345
+ Func->getNumWrittenParams () + isa<CXXOperatorCallExpr>(E);
3345
3346
for (unsigned I = NumParams, N = E->getNumArgs (); I != N; ++I)
3346
3347
VarArgSize += align (primSize (classify (E->getArg (I)).value_or (PT_Ptr)));
3347
3348
Original file line number Diff line number Diff line change @@ -1467,3 +1467,16 @@ namespace IgnoredCtorWithZeroInit {
1467
1467
return (S (), true );
1468
1468
}
1469
1469
}
1470
+
1471
+ #if __cplusplus >= 202002L
1472
+ namespace VirtOperator {
1473
+ // / This used to crash because it's a virtual CXXOperatorCallExpr.
1474
+ struct B {
1475
+ virtual constexpr bool operator ==(const B&) const { return true ; }
1476
+ };
1477
+ struct D : B {
1478
+ constexpr bool operator ==(const B&) const override { return false ; } // both-note {{operator}}
1479
+ };
1480
+ constexpr bool cmp_base_derived = D() == D(); // both-warning {{ambiguous}}
1481
+ }
1482
+ #endif
You can’t perform that action at this time.
0 commit comments