From 6dfb50adbbc259befb4c03b4559df7c52562c4db Mon Sep 17 00:00:00 2001 From: Erik Pilkington Date: Tue, 8 Jan 2019 17:04:38 +0000 Subject: [PATCH] Revert "Split -Wdelete-non-virtual-dtor into -Wdelete-abstract-non-virtual-dtor" This reverts commit r350585. There was some late post-commit review on phab. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350639 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticGroups.td | 2 -- include/clang/Basic/DiagnosticSemaKinds.td | 2 +- test/SemaCXX/non-virtual-dtors.cpp | 32 ---------------------- 3 files changed, 1 insertion(+), 35 deletions(-) delete mode 100644 test/SemaCXX/non-virtual-dtors.cpp diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td index 52bd87d79a..6ba6c19a28 100644 --- a/include/clang/Basic/DiagnosticGroups.td +++ b/include/clang/Basic/DiagnosticGroups.td @@ -105,8 +105,6 @@ def MissingNoEscape : DiagGroup<"missing-noescape">; def DeleteIncomplete : DiagGroup<"delete-incomplete">; def DeleteNonVirtualDtor : DiagGroup<"delete-non-virtual-dtor">; -def DeleteAbstractNonVirtualDtor : DiagGroup<"delete-abstract-non-virtual-dtor", - [DeleteNonVirtualDtor]>; def AbstractFinalClass : DiagGroup<"abstract-final-class">; def CXX11CompatDeprecatedWritableStr : diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index d6c5ccffd8..c54fbc8b4c 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -6460,7 +6460,7 @@ def note_delete_non_virtual : Note< "qualify call to silence this warning">; def warn_delete_abstract_non_virtual_dtor : Warning< "%select{delete|destructor}0 called on %1 that is abstract but has " - "non-virtual destructor">, InGroup, ShowInSystemHeader; + "non-virtual destructor">, InGroup, ShowInSystemHeader; def warn_overloaded_virtual : Warning< "%q0 hides overloaded virtual %select{function|functions}1">, InGroup, DefaultIgnore; diff --git a/test/SemaCXX/non-virtual-dtors.cpp b/test/SemaCXX/non-virtual-dtors.cpp deleted file mode 100644 index 230b899a7f..0000000000 --- a/test/SemaCXX/non-virtual-dtors.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// RUN: %clang_cc1 %s -verify -DDIAG1 -// RUN: %clang_cc1 %s -verify -DDIAG1 -DDIAG2 -Wdelete-non-virtual-dtor -// RUN: %clang_cc1 %s -verify -DDIAG1 -Wmost -Wno-delete-non-virtual-dtor -// RUN: %clang_cc1 %s -verify -Wmost -Wno-delete-abstract-non-virtual-dtor - -#ifndef DIAG1 -#ifndef DIAG2 -// expected-no-diagnostics -#endif -#endif - -struct S1 { - ~S1() {} - virtual void abs() = 0; -}; - -void f1(S1 *s1) { delete s1; } -#ifdef DIAG1 -// expected-warning@-2 {{delete called on 'S1' that is abstract but has non-virtual destructor}} -#endif - -struct Base { - virtual void abs() = 0; -}; -struct S2 : Base { - ~S2() {} - void abs() {} -}; -void f2(S2 *s2) { delete s2; } -#ifdef DIAG2 -// expected-warning@-2 {{delete called on non-final 'S2' that has virtual functions but non-virtual destructor}} -#endif -- 2.40.0