[clang] [clang] __is_trivially_equality_comparable for types containing lambdas (PR #68506)

via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 10 00:20:20 PDT 2023


================
@@ -2663,6 +2663,9 @@ static bool
 HasNonDeletedDefaultedEqualityComparison(const CXXRecordDecl *Decl) {
   if (Decl->isUnion())
     return false;
+  if (Decl->isLambda())
+    return Decl->captures().empty() &&
+           (Decl->getLambdaCaptureDefault() == LCD_None);
----------------
cor3ntin wrote:

This pattern is used in a few places, maybe we should factor it out

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


More information about the cfe-commits mailing list