From: David Bolvansky Date: Tue, 3 Sep 2019 10:54:25 +0000 (+0000) Subject: Fixit for -Wfinal-dtor-non-final-class X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a5a7627becc670c8e27fbe01b0839fdaea18569;p=clang Fixit for -Wfinal-dtor-non-final-class git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370740 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index e2f0aef7bf..f5ec46f810 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -6242,7 +6242,6 @@ void Sema::CheckCompletedCXXClass(CXXRecordDecl *Record) { if (const FinalAttr *FA = dtor->getAttr()) { 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")); diff --git a/test/SemaCXX/warn-final-dtor-non-final-class.cpp b/test/SemaCXX/warn-final-dtor-non-final-class.cpp index fdfe2ee3b4..a96aa4436e 100644 --- a/test/SemaCXX/warn-final-dtor-non-final-class.cpp +++ b/test/SemaCXX/warn-final-dtor-non-final-class.cpp @@ -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 {