From bf9872a7b540b13dd1b8034cbe24607ef68f2fae Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Thu, 23 Dec 2021 10:19:22 -0800 Subject: [PATCH] Enable modernize-use-equals-default clang tidy rule Summary: changelog: [internal] You can read more about this rule on https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-equals-default.html Reviewed By: rubennorte Differential Revision: D33295116 fbshipit-source-id: d7da62c35e141fc2bf5a83c28f80f4f8d355c4cb --- ReactCommon/react/renderer/.clang-tidy | 1 + ReactCommon/react/renderer/core/Sealable.cpp | 2 +- .../templateprocessor/tests/UITemplateProcessorTest.cpp | 2 +- .../react/renderer/textlayoutmanager/TextLayoutManager.cpp | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ReactCommon/react/renderer/.clang-tidy b/ReactCommon/react/renderer/.clang-tidy index f4da270c1a4..1f9babb38a9 100644 --- a/ReactCommon/react/renderer/.clang-tidy +++ b/ReactCommon/react/renderer/.clang-tidy @@ -20,5 +20,6 @@ modernize-replace-random-shuffle, modernize-unary-static-assert, modernize-use-emplace, modernize-shrink-to-fit, +modernize-use-equals-default, ' ... diff --git a/ReactCommon/react/renderer/core/Sealable.cpp b/ReactCommon/react/renderer/core/Sealable.cpp index 2326a4ed7b2..b1a1c91988b 100644 --- a/ReactCommon/react/renderer/core/Sealable.cpp +++ b/ReactCommon/react/renderer/core/Sealable.cpp @@ -35,7 +35,7 @@ Sealable::Sealable(Sealable &&other) noexcept : sealed_(false) { other.ensureUnsealed(); }; -Sealable::~Sealable() noexcept {}; +Sealable::~Sealable() noexcept = default; Sealable &Sealable::operator=(const Sealable &other) { ensureUnsealed(); diff --git a/ReactCommon/react/renderer/templateprocessor/tests/UITemplateProcessorTest.cpp b/ReactCommon/react/renderer/templateprocessor/tests/UITemplateProcessorTest.cpp index 8f2b2a068dc..3c9c2941f16 100644 --- a/ReactCommon/react/renderer/templateprocessor/tests/UITemplateProcessorTest.cpp +++ b/ReactCommon/react/renderer/templateprocessor/tests/UITemplateProcessorTest.cpp @@ -56,7 +56,7 @@ NativeModuleRegistry buildNativeModuleRegistry() { class MockReactNativeConfig : public ReactNativeConfig { public: - MockReactNativeConfig() {} + MockReactNativeConfig() = default; bool getBool(const std::string ¶m) const override { return mockSimpleTestValue_; } diff --git a/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp b/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp index f0502d5a28a..24db520f337 100644 --- a/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp +++ b/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp @@ -20,7 +20,7 @@ using namespace facebook::jni; namespace facebook { namespace react { -TextLayoutManager::~TextLayoutManager() {} +TextLayoutManager::~TextLayoutManager() = default; void *TextLayoutManager::getNativeTextLayoutManager() const { return self_;