================
@@ -2595,6 +2596,105 @@ static void DiagnoseNonStandardLayoutReason(Sema 
&SemaRef, SourceLocation Loc,
   SemaRef.Diag(D->getLocation(), diag::note_defined_here) << D;
 }
 
+static void DiagnoseNonAggregateReason(Sema &SemaRef, SourceLocation Loc,
+                                       const CXXRecordDecl *D) {
+  for (const CXXConstructorDecl *Ctor : D->ctors()) {
+    if (Ctor->isUserProvided())
+      SemaRef.Diag(Loc, diag::note_unsatisfied_trait_reason)
+          << diag::TraitNotSatisfiedReason::UserDeclaredCtr;
+    if (Ctor->isInheritingConstructor())
+      SemaRef.Diag(Loc, diag::note_unsatisfied_trait_reason)
+          << diag::TraitNotSatisfiedReason::InheritedCtr;
+  }
+
+  bool HasInherited = false;
+  for (const Decl *Sub : D->decls()) {
+    if (auto *UD = dyn_cast<UsingDecl>(Sub)) {
+      for (auto I = UD->shadow_begin(), E = UD->shadow_end(); I != E; ++I) {
+        if (isa<ConstructorUsingShadowDecl>(*I)) {
+          HasInherited = true;
+          break;
+        }
+      }
+      if (HasInherited)
+        break;
+    }
+    if (isa<ConstructorUsingShadowDecl>(Sub)) {
+      HasInherited = true;
+      break;
+    }
+  }
----------------
zwuis wrote:

We can use `llvm::any_of` defined in `llvm/ADT/STLExtras.h`.

https://github.com/llvm/llvm-project/pull/152488
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to