<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Sure, for posterity: this was originally committed in r350585 and
reverted in r350639. The original commit added
-Wdelete-abstract-non-virtual-dtor as a group including
-Wdelete-non-virtual-dtor, which led to strange cli behaviour.<br>
<br>
Thanks!<br>
<br>
<div class="moz-cite-prefix">On 1/13/19 5:28 PM, David Blaikie
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAENS6EsffOadgeZHzjEVChf3s6Xf0KxvdGNrRtFa3E2Xd8T1yA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Might be handy to summarize the changes from the
previous reverted version of this patch (& mention the
original commit revision and revert revision) - in the commit
message is ideal, but in a reply to the commit after the fact
will do in a pinch</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Fri, Jan 11, 2019 at 4:06 AM Erik Pilkington
via cfe-commits <<a
href="mailto:cfe-commits@lists.llvm.org"
moz-do-not-send="true">cfe-commits@lists.llvm.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Author:
epilk<br>
Date: Thu Jan 10 10:03:07 2019<br>
New Revision: 350856<br>
<br>
URL: <a
href="http://llvm.org/viewvc/llvm-project?rev=350856&view=rev"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://llvm.org/viewvc/llvm-project?rev=350856&view=rev</a><br>
Log:<br>
Split -Wdelete-non-virtual-dtor into two groups<br>
<br>
This group controls two diagnostics: deleting an abstract
class with<br>
a non-virtual dtor, which is a guaranteed crash, and deleting
a<br>
non-abstract polymorphic class with a non-virtual dtor, which
is just<br>
suspicious.<br>
<br>
<a class="moz-txt-link-freetext" href="rdar://40380564">rdar://40380564</a><br>
<br>
Differential revision: <a
href="https://reviews.llvm.org/D56405" rel="noreferrer"
target="_blank" moz-do-not-send="true">https://reviews.llvm.org/D56405</a><br>
<br>
Added:<br>
cfe/trunk/test/SemaCXX/delete-non-virtual-dtor.cpp<br>
Modified:<br>
cfe/trunk/include/clang/Basic/DiagnosticGroups.td<br>
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br>
<br>
Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td<br>
URL: <a
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=350856&r1=350855&r2=350856&view=diff"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=350856&r1=350855&r2=350856&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Basic/DiagnosticGroups.td
(original)<br>
+++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Thu Jan
10 10:03:07 2019<br>
@@ -104,7 +104,11 @@ def UndefinedFuncTemplate :
DiagGroup<"u<br>
def MissingNoEscape : DiagGroup<"missing-noescape">;<br>
<br>
def DeleteIncomplete : DiagGroup<"delete-incomplete">;<br>
-def DeleteNonVirtualDtor :
DiagGroup<"delete-non-virtual-dtor">;<br>
+def DeleteNonAbstractNonVirtualDtor :
DiagGroup<"delete-non-abstract-non-virtual-dtor">;<br>
+def DeleteAbstractNonVirtualDtor :
DiagGroup<"delete-abstract-non-virtual-dtor">;<br>
+def DeleteNonVirtualDtor :
DiagGroup<"delete-non-virtual-dtor",<br>
+
[DeleteNonAbstractNonVirtualDtor,<br>
+
DeleteAbstractNonVirtualDtor]>;<br>
def AbstractFinalClass :
DiagGroup<"abstract-final-class">;<br>
<br>
def CXX11CompatDeprecatedWritableStr :<br>
<br>
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br>
URL: <a
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=350856&r1=350855&r2=350856&view=diff"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=350856&r1=350855&r2=350856&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
(original)<br>
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Thu
Jan 10 10:03:07 2019<br>
@@ -6455,12 +6455,12 @@ def warn_non_virtual_dtor :
Warning<<br>
def warn_delete_non_virtual_dtor : Warning<<br>
"%select{delete|destructor}0 called on non-final %1 that
has "<br>
"virtual functions but non-virtual destructor">,<br>
- InGroup<DeleteNonVirtualDtor>, DefaultIgnore,
ShowInSystemHeader;<br>
+ InGroup<DeleteNonAbstractNonVirtualDtor>,
DefaultIgnore, ShowInSystemHeader;<br>
def note_delete_non_virtual : Note<<br>
"qualify call to silence this warning">;<br>
def warn_delete_abstract_non_virtual_dtor : Warning<<br>
"%select{delete|destructor}0 called on %1 that is abstract
but has "<br>
- "non-virtual destructor">,
InGroup<DeleteNonVirtualDtor>, ShowInSystemHeader;<br>
+ "non-virtual destructor">,
InGroup<DeleteAbstractNonVirtualDtor>,
ShowInSystemHeader;<br>
def warn_overloaded_virtual : Warning<<br>
"%q0 hides overloaded virtual
%select{function|functions}1">,<br>
InGroup<OverloadedVirtual>, DefaultIgnore;<br>
<br>
Added: cfe/trunk/test/SemaCXX/delete-non-virtual-dtor.cpp<br>
URL: <a
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/delete-non-virtual-dtor.cpp?rev=350856&view=auto"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/delete-non-virtual-dtor.cpp?rev=350856&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/SemaCXX/delete-non-virtual-dtor.cpp (added)<br>
+++ cfe/trunk/test/SemaCXX/delete-non-virtual-dtor.cpp Thu Jan
10 10:03:07 2019<br>
@@ -0,0 +1,30 @@<br>
+// RUN: %clang_cc1 %s -verify -DDIAG1<br>
+// RUN: %clang_cc1 %s -verify -DDIAG1 -DDIAG2
-Wdelete-non-virtual-dtor<br>
+// RUN: %clang_cc1 %s -verify -DDIAG1 -Wmost
-Wno-delete-non-abstract-non-virtual-dtor<br>
+// RUN: %clang_cc1 %s -verify -DDIAG2 -Wmost
-Wno-delete-abstract-non-virtual-dtor<br>
+// RUN: %clang_cc1 %s -verify -Wmost
-Wno-delete-non-virtual-dtor<br>
+<br>
+#ifndef DIAG1<br>
+#ifndef DIAG2<br>
+// expected-no-diagnostics<br>
+#endif<br>
+#endif<br>
+<br>
+struct S1 {<br>
+ ~S1() {}<br>
+ virtual void abs() = 0;<br>
+};<br>
+<br>
+void f1(S1 *s1) { delete s1; }<br>
+#ifdef DIAG1<br>
+// expected-warning@-2 {{delete called on 'S1' that is
abstract but has non-virtual destructor}}<br>
+#endif<br>
+<br>
+struct S2 {<br>
+ ~S2() {}<br>
+ virtual void real() {}<br>
+};<br>
+void f2(S2 *s2) { delete s2; }<br>
+#ifdef DIAG2<br>
+// expected-warning@-2 {{delete called on non-final 'S2' that
has virtual functions but non-virtual destructor}}<br>
+#endif<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank"
moz-do-not-send="true">cfe-commits@lists.llvm.org</a><br>
<a
href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote>
</div>
</blockquote>
<br>
</body>
</html>