================
@@ -2399,6 +2400,66 @@ static void DiagnoseNonConstructibleReason(
SemaRef.Diag(D->getLocation(), diag::note_defined_here) << D;
}
+static void DiagnoseNonDestructibleReason(Sema &SemaRef, SourceLocation Loc,
+ QualType T) {
+
+ QualType CoreT = T.getCanonicalType();
+ if (const ArrayType *AT = SemaRef.Context.getAsArrayType(CoreT))
+ CoreT = AT->getElementType();
+
+ SemaRef.Diag(Loc, diag::note_unsatisfied_trait)
+ << CoreT << diag::TraitName::Destructible;
+
+ if (CoreT->isFunctionType()) {
+ SemaRef.Diag(Loc, diag::note_unsatisfied_trait_reason)
+ << diag::TraitNotSatisfiedReason::FunctionType;
+ return;
+ }
+
+ if (CoreT->isVoidType()) {
+ SemaRef.Diag(Loc, diag::note_unsatisfied_trait_reason)
+ << diag::TraitNotSatisfiedReason::CVVoidType;
+ return;
+ }
+
+ if (CoreT->isIncompleteType()) {
+ SemaRef.Diag(Loc, diag::note_unsatisfied_trait_reason)
+ << diag::TraitNotSatisfiedReason::IncompleteType;
+ return;
+ }
----------------
zyn0217 wrote:
Can you test this branch?
https://github.com/llvm/llvm-project/pull/167291
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits