[PATCH] D31780: Add a virtual destructor to a class with virtual methods.

Ivan Krasin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 11:41:58 PDT 2017


krasin created this revision.
Herald added a subscriber: kubamracek.

Recently, Clang enabled the check for virtual destructors
in the presence of virtual methods. That broke the bootstrap
build. Fixing it.

This is a second attempt to fix this. Now, with out-of-line definition.


https://reviews.llvm.org/D31780

Files:
  lib/sanitizer_common/sanitizer_flag_parser.cc
  lib/sanitizer_common/sanitizer_flag_parser.h


Index: lib/sanitizer_common/sanitizer_flag_parser.h
===================================================================
--- lib/sanitizer_common/sanitizer_flag_parser.h
+++ lib/sanitizer_common/sanitizer_flag_parser.h
@@ -22,6 +22,7 @@
 
 class FlagHandlerBase {
  public:
+  virtual ~FlagHandlerBase();
   virtual bool Parse(const char *value) { return false; }
 };
 
Index: lib/sanitizer_common/sanitizer_flag_parser.cc
===================================================================
--- lib/sanitizer_common/sanitizer_flag_parser.cc
+++ lib/sanitizer_common/sanitizer_flag_parser.cc
@@ -20,6 +20,8 @@
 
 namespace __sanitizer {
 
+FlagHandlerBase::~FlagHandlerBase() {}
+
 LowLevelAllocator FlagParser::Alloc;
 
 class UnknownFlags {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31780.94408.patch
Type: text/x-patch
Size: 741 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170406/b72004f4/attachment.bin>


More information about the llvm-commits mailing list