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).

On Mon, Mar 2, 2020 at 7:07 AM Simon Pilgrim via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

>
> Author: Simon Pilgrim
> Date: 2020-03-02T15:06:34Z
> New Revision: 736385c0b49d42f398ffa1458883f0d182178ef4
>
> URL:
> https://github.com/llvm/llvm-project/commit/736385c0b49d42f398ffa1458883f0d182178ef4
> DIFF:
> https://github.com/llvm/llvm-project/commit/736385c0b49d42f398ffa1458883f0d182178ef4.diff
>
> LOG: EHScopeStack::Cleanup has virtual functions so the destructor should
> be too.
>
> Fixes cppcheck warning.
>
> Added:
>
>
> Modified:
>     clang/lib/CodeGen/EHScopeStack.h
>
> Removed:
>
>
>
>
> ################################################################################
> diff  --git a/clang/lib/CodeGen/EHScopeStack.h
> b/clang/lib/CodeGen/EHScopeStack.h
> index 0ed67aabcd62..4dd3da3e90e7 100644
> --- a/clang/lib/CodeGen/EHScopeStack.h
> +++ b/clang/lib/CodeGen/EHScopeStack.h
> @@ -148,7 +148,7 @@ class EHScopeStack {
>      virtual void anchor();
>
>    protected:
> -    ~Cleanup() = default;
> +    virtual ~Cleanup() = default;
>
>    public:
>      Cleanup(const Cleanup &) = default;
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to