diff options
Diffstat (limited to 'clang/lib/CodeGen/EHScopeStack.h')
-rw-r--r-- | clang/lib/CodeGen/EHScopeStack.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/EHScopeStack.h b/clang/lib/CodeGen/EHScopeStack.h index b4fba596a29..6d01095dfa7 100644 --- a/clang/lib/CodeGen/EHScopeStack.h +++ b/clang/lib/CodeGen/EHScopeStack.h @@ -145,6 +145,9 @@ public: // Anchor the construction vtable. virtual void anchor(); + protected: + ~Cleanup() = default; + public: Cleanup(const Cleanup &) = default; Cleanup(Cleanup &&) {} @@ -176,10 +179,6 @@ public: void setIsEHCleanupKind() { flags |= F_IsEHCleanupKind; } }; - // Provide a virtual destructor to suppress a very common warning - // that unfortunately cannot be suppressed without this. Cleanups - // should not rely on this destructor ever being called. - virtual ~Cleanup() {} /// Emit the cleanup. For normal cleanups, this is run in the /// same EH context as when the cleanup was pushed, i.e. the @@ -192,7 +191,8 @@ public: /// ConditionalCleanup stores the saved form of its parameters, /// then restores them and performs the cleanup. - template <class T, class... As> class ConditionalCleanup : public Cleanup { + template <class T, class... As> + class ConditionalCleanup final : public Cleanup { typedef std::tuple<typename DominatingValue<As>::saved_type...> SavedTuple; SavedTuple Saved; |