summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index a5b4eda43c5..e2f0aef7bf6 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -6241,10 +6241,14 @@ void Sema::CheckCompletedCXXClass(CXXRecordDecl *Record) {
if (const CXXDestructorDecl *dtor = Record->getDestructor()) {
if (const FinalAttr *FA = dtor->getAttr<FinalAttr>()) {
Diag(FA->getLocation(), diag::warn_final_dtor_non_final_class)
- << FA->isSpelledAsSealed();
- Diag(Record->getLocation(), diag::note_final_dtor_non_final_class_silence)
- << Context.getRecordType(Record)
- << FA->isSpelledAsSealed();
+ << FA->isSpelledAsSealed()
+ << FixItHint::CreateRemoval(FA->getLocation())
+ << FixItHint::CreateInsertion(
+ getLocForEndOfToken(Record->getLocation()),
+ (FA->isSpelledAsSealed() ? " sealed" : " final"));
+ Diag(Record->getLocation(),
+ diag::note_final_dtor_non_final_class_silence)
+ << Context.getRecordType(Record) << FA->isSpelledAsSealed();
}
}
}
OpenPOWER on IntegriCloud