================
@@ -503,6 +503,41 @@ static bool HasNoThrowOperator(CXXRecordDecl *RD,
OverloadedOperatorKind Op,
return false;
}
+static bool equalityComparisonIsDefaulted(Sema &S, const TagDecl *Decl,
+ SourceLocation KeyLoc) {
+ CanQualType T = S.Context.getCanonicalTagType(Decl);
+
+ EnterExpressionEvaluationContext UnevaluatedContext(
+ S, Sema::ExpressionEvaluationContext::Unevaluated);
+ Sema::SFINAETrap SFINAE(S, /*WithAccessChecking=*/true);
+ Sema::ContextRAII TUContext(S, S.Context.getTranslationUnitDecl());
+
+ // const ClassT& obj;
+ OpaqueValueExpr Operand(KeyLoc, T.withConst(), ExprValueKind::VK_LValue);
+ UnresolvedSet<16> Functions;
+ // obj == obj;
+ S.LookupBinOp(S.TUScope, {}, BinaryOperatorKind::BO_EQ, Functions);
+
+ auto Result = S.CreateOverloadedBinOp(KeyLoc, BinaryOperatorKind::BO_EQ,
----------------
Fznamznon wrote:
Could you please spell out the type?
```suggestion
ExprResult Result = S.CreateOverloadedBinOp(KeyLoc, BinaryOperatorKind::BO_EQ,
```
https://github.com/llvm/llvm-project/pull/169079
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits