]> granicus.if.org Git - clang/commitdiff
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)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370740 91177308-0d34-0410-b5e6-96231b3b80d8

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

index e2f0aef7bf6b447d0859b94602d28d9ab83170ea..f5ec46f810fbf53d507d747b494e1d77c8716be8 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 fdfe2ee3b41bfb1494236f38c35c4174fe539bca..a96aa4436e8185f45e7f0d22db8dd4313e1f8ff8 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 {