26 return llvm::any_of(Node.bases(), [&](
const CXXBaseSpecifier &BaseSpec) {
47 const auto *MatchedDecl = Result.Nodes.getNodeAs<CXXDestructorDecl>(
"decl");
50 const SourceManager &SM = *Result.SourceManager;
51 const auto *FirstDecl = cast<CXXMethodDecl>(MatchedDecl->getFirstDecl());
53 FirstDecl->getEndLoc(), SM, getLangOpts());
54 const CharSourceRange SecondDeclRange = CharSourceRange::getTokenRange(
55 MatchedDecl->getBeginLoc(),
58 if (FirstDeclEnd.isInvalid() || SecondDeclRange.isInvalid())
62 diag(FirstDecl->getLocation(),
63 "class %0 can be made trivially destructible by defaulting the "
64 "destructor on its first declaration")
65 << FirstDecl->getParent()
66 << FixItHint::CreateInsertion(FirstDeclEnd,
" = default")
67 << FixItHint::CreateRemoval(SecondDeclRange);
68 diag(MatchedDecl->getLocation(),
"destructor definition is here",