[PATCH] D56405: Split -Wdelete-non-virtual-dtor into two groups
Richard Smith - zygoloid via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 7 16:51:24 PST 2019
rsmith added inline comments.
================
Comment at: include/clang/Basic/DiagnosticGroups.td:108-109
def DeleteNonVirtualDtor : DiagGroup<"delete-non-virtual-dtor">;
+def DeleteAbstractNonVirtualDtor : DiagGroup<"delete-abstract-non-virtual-dtor",
+ [DeleteNonVirtualDtor]>;
def AbstractFinalClass : DiagGroup<"abstract-final-class">;
----------------
This is backwards: this says that `-Wdelete-abstract-non-virtual-dtor` also controls `-Wdelete-non-virtual-dtor`. You presumably want the opposite relationship, so that `-Wdelete-non-virtual-dtor` controls both warnings and `-Wdelete-abstract-non-virtual-dtor` only controls the "abstract" warning.
================
Comment at: test/SemaCXX/non-virtual-dtors.cpp:3-4
+// 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
+
----------------
The test also verifies that the `-W` flags are wrong :)
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56405/new/
https://reviews.llvm.org/D56405
More information about the cfe-commits
mailing list