<div dir="ltr">I've reverted this in b5eafda8d3ef02f9f78e090725564dd28e573322 - the warning isn't accurate/appropriate - this type is safe as it was previously written (having a protected non-virtual dtor and derived classes being final with a non-virtual dtor - so there's no way (well, inside the base class you could, but that's a very limited scope) to polymorphically destroy this type accidentally/slicing, etc).<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 2, 2020 at 7:07 AM Simon Pilgrim via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Simon Pilgrim<br>
Date: 2020-03-02T15:06:34Z<br>
New Revision: 736385c0b49d42f398ffa1458883f0d182178ef4<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/736385c0b49d42f398ffa1458883f0d182178ef4" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/736385c0b49d42f398ffa1458883f0d182178ef4</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/736385c0b49d42f398ffa1458883f0d182178ef4.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/736385c0b49d42f398ffa1458883f0d182178ef4.diff</a><br>
<br>
LOG: EHScopeStack::Cleanup has virtual functions so the destructor should be too.<br>
<br>
Fixes cppcheck warning.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    clang/lib/CodeGen/EHScopeStack.h<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/clang/lib/CodeGen/EHScopeStack.h b/clang/lib/CodeGen/EHScopeStack.h<br>
index 0ed67aabcd62..4dd3da3e90e7 100644<br>
--- a/clang/lib/CodeGen/EHScopeStack.h<br>
+++ b/clang/lib/CodeGen/EHScopeStack.h<br>
@@ -148,7 +148,7 @@ class EHScopeStack {<br>
     virtual void anchor();<br>
<br>
   protected:<br>
-    ~Cleanup() = default;<br>
+    virtual ~Cleanup() = default;<br>
<br>
   public:<br>
     Cleanup(const Cleanup &) = default;<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>