From: Pierluigi Taddei Date: Fri, 27 Aug 2021 17:36:08 +0000 (-0700) Subject: [caffe2] fixes to allow stricter compilation flag (#64016) X-Git-Tag: accepted/tizen/8.0/unified/20231005.095509~647 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=538c30a713a1ee2a3d654c3e1cdf9cc20b7d8c72;p=platform%2Fupstream%2Fpytorch.git [caffe2] fixes to allow stricter compilation flag (#64016) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/64016 In order to increase the strictness of the compilation for some target depending on caffe2 we need to fix some errors uncovered when rising such flags. This change introduces the required override tokens for virtual destructors Test Plan: CI. Moreover targets depending on caffe2 using clang strict warnings now compile Reviewed By: kalman5 Differential Revision: D30541714 fbshipit-source-id: 564af31b4a9df3536d7d6f43ad29e1d0c7040551 --- diff --git a/aten/src/ATen/CPUGeneratorImpl.h b/aten/src/ATen/CPUGeneratorImpl.h index f8b43a0..69dbb8b 100644 --- a/aten/src/ATen/CPUGeneratorImpl.h +++ b/aten/src/ATen/CPUGeneratorImpl.h @@ -10,7 +10,7 @@ namespace at { struct TORCH_API CPUGeneratorImpl : public c10::GeneratorImpl { // Constructors CPUGeneratorImpl(uint64_t seed_in = default_rng_seed_val); - ~CPUGeneratorImpl() = default; + ~CPUGeneratorImpl() override = default; // CPUGeneratorImpl methods std::shared_ptr clone() const; diff --git a/aten/src/ATen/core/builtin_function.h b/aten/src/ATen/core/builtin_function.h index de30f9b..600c16b 100644 --- a/aten/src/ATen/core/builtin_function.h +++ b/aten/src/ATen/core/builtin_function.h @@ -123,7 +123,7 @@ struct BuiltinOpFunction : public Function { return *this; } - ~BuiltinOpFunction() {} + ~BuiltinOpFunction() override {} private: c10::QualifiedName name_; diff --git a/c10/core/StorageImpl.h b/c10/core/StorageImpl.h index ff29b68..bea717d 100644 --- a/c10/core/StorageImpl.h +++ b/c10/core/StorageImpl.h @@ -68,7 +68,7 @@ struct C10_API StorageImpl final : public c10::intrusive_ptr_target { StorageImpl() = delete; StorageImpl(StorageImpl&& other) = default; StorageImpl(const StorageImpl&) = delete; - ~StorageImpl() = default; + ~StorageImpl() override = default; void reset() { data_ptr_.clear(); diff --git a/caffe2/serialize/istream_adapter.h b/caffe2/serialize/istream_adapter.h index 8960d55..680c288 100644 --- a/caffe2/serialize/istream_adapter.h +++ b/caffe2/serialize/istream_adapter.h @@ -16,7 +16,7 @@ class TORCH_API IStreamAdapter final : public ReadAdapterInterface { size_t size() const override; size_t read(uint64_t pos, void* buf, size_t n, const char* what = "") const override; - ~IStreamAdapter(); + ~IStreamAdapter() override; private: std::istream* istream_;