[clang] [Clang] Check explicit object parameter for defaulted operators properly (PR #100419)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 24 11:26:38 PDT 2024


================
@@ -7617,9 +7617,13 @@ bool Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD,
     // parameter is of (possibly different) type “reference to C”,
     // in which case the type of F1 would differ from the type of F2
     // in that the type of F1 has an additional parameter;
-    if (!Context.hasSameType(
-            ThisType.getNonReferenceType().getUnqualifiedType(),
-            Context.getRecordType(RD))) {
----------------
cor3ntin wrote:

I think your change loses this check - this is the ` bool S::operator==(int) = default` case

https://github.com/llvm/llvm-project/pull/100419


More information about the cfe-commits mailing list