Fixit for -Wfinal-dtor-non-final-class
authorDavid Bolvansky <david.bolvansky@gmail.com>
Tue, 3 Sep 2019 10:54:25 +0000 (10:54 +0000)
committerDavid Bolvansky <david.bolvansky@gmail.com>
Tue, 3 Sep 2019 10:54:25 +0000 (10:54 +0000)
llvm-svn: 370740

clang/lib/Sema/SemaDeclCXX.cpp
clang/test/SemaCXX/warn-final-dtor-non-final-class.cpp

index e2f0aef..f5ec46f 100644 (file)
@@ -6242,7 +6242,6 @@ void Sema::CheckCompletedCXXClass(CXXRecordDecl *Record) {
       if (const FinalAttr *FA = dtor->getAttr<FinalAttr>()) {
         Diag(FA->getLocation(), diag::warn_final_dtor_non_final_class)
             << FA->isSpelledAsSealed()
-            << FixItHint::CreateRemoval(FA->getLocation())
             << FixItHint::CreateInsertion(
                    getLocForEndOfToken(Record->getLocation()),
                    (FA->isSpelledAsSealed() ? " sealed" : " final"));
index fdfe2ee..a96aa44 100644 (file)
@@ -8,7 +8,6 @@ class A {
 class B { // expected-note {{mark 'B' as 'final' to silence this warning}}
     // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:8-[[@LINE-1]]:8}:" final"
     virtual ~B() final; // expected-warning {{class with destructor marked 'final' cannot be inherited from}}
-    // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:18-[[@LINE-1]]:23}:""
 };
 
 class C final {