[PATCH] D66711: [clang] Warning for non-final classes with final destructors
Arthur O'Dwyer via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Aug 25 08:17:24 PDT 2019
Quuxplusone added inline comments.
================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:2204
"abstract class is marked '%select{final|sealed}0'">, InGroup<AbstractFinalClass>;
+def warn_final_destructor_nonfinal_class : Warning<
+ "class with destructor marked '%select{final|sealed}0' cannot be inherited from">,
----------------
Is there any good reason to spell it `dtor` in the preceding file but `destructor` in this one? I think the spelling should be consistent one way or the other. Helps with greppability/maintainability.
================
Comment at: clang/test/SemaCXX/warn-final-dtor-nonfinal-class.cpp:12
+class C final {
+ virtual ~C() final;
+};
----------------
Should there be a test for the `sealed` spelling?
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66711/new/
https://reviews.llvm.org/D66711
More information about the cfe-commits
mailing list