r370740 - Fixit for -Wfinal-dtor-non-final-class

David Bolvansky via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 3 03:54:25 PDT 2019


Author: xbolva00
Date: Tue Sep  3 03:54:25 2019
New Revision: 370740

URL: http://llvm.org/viewvc/llvm-project?rev=370740&view=rev
Log:
Fixit for -Wfinal-dtor-non-final-class

Modified:
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp
    cfe/trunk/test/SemaCXX/warn-final-dtor-non-final-class.cpp

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=370740&r1=370739&r2=370740&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Tue Sep  3 03:54:25 2019
@@ -6242,7 +6242,6 @@ void Sema::CheckCompletedCXXClass(CXXRec
       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"));

Modified: cfe/trunk/test/SemaCXX/warn-final-dtor-non-final-class.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/warn-final-dtor-non-final-class.cpp?rev=370740&r1=370739&r2=370740&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/warn-final-dtor-non-final-class.cpp (original)
+++ cfe/trunk/test/SemaCXX/warn-final-dtor-non-final-class.cpp Tue Sep  3 03:54:25 2019
@@ -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 {




More information about the cfe-commits mailing list