diff options
-rw-r--r-- | artd/artd_test.cc | 2 | ||||
-rw-r--r-- | build/Android.bp | 2 | ||||
-rw-r--r-- | libartbase/base/array_slice.h | 4 | ||||
-rw-r--r-- | libartbase/base/stride_iterator.h | 4 | ||||
-rw-r--r-- | openjdkjvmti/art_jvmti.h | 4 | ||||
-rw-r--r-- | openjdkjvmti/ti_redefine.h | 4 | ||||
-rw-r--r-- | runtime/jit/jit.cc | 2 | ||||
-rw-r--r-- | test/ti-agent/scoped_utf_chars.h | 4 |
8 files changed, 13 insertions, 13 deletions
diff --git a/artd/artd_test.cc b/artd/artd_test.cc index f16a58e023..80b4ceac34 100644 --- a/artd/artd_test.cc +++ b/artd/artd_test.cc @@ -47,7 +47,7 @@ class ScopedCap { public: explicit ScopedCap(cap_t cap) : cap_(cap) { CHECK_NE(cap, nullptr); } - ScopedCap(ScopedCap&& other) : cap_(std::exchange(other.cap_, nullptr)) {} + ScopedCap(ScopedCap&& other) noexcept : cap_(std::exchange(other.cap_, nullptr)) {} ~ScopedCap() { if (cap_ != nullptr) { diff --git a/build/Android.bp b/build/Android.bp index 2d6fe04250..015657669f 100644 --- a/build/Android.bp +++ b/build/Android.bp @@ -40,6 +40,7 @@ art_clang_tidy_errors = [ "performance-implicit-conversion-in-loop", "performance-unnecessary-copy-initialization", "performance-unnecessary-value-param", + "performance-noexcept-move-constructor", ] art_clang_tidy_allowed = [ @@ -50,7 +51,6 @@ art_clang_tidy_allowed = [ "misc-unused-using-decls", "modernize-use-nullptr", "modernize-use-using", // TODO: move to art_clang_tidy_errors after b/236243696 is done - "performance-noexcept-move-constructor", ] art_clang_tidy_disabled = [ diff --git a/libartbase/base/array_slice.h b/libartbase/base/array_slice.h index a58ff4439d..067d9f284f 100644 --- a/libartbase/base/array_slice.h +++ b/libartbase/base/array_slice.h @@ -65,9 +65,9 @@ class ArraySlice { lpa != nullptr ? lpa->size() : 0, element_size) {} ArraySlice(const ArraySlice<T>&) = default; - ArraySlice(ArraySlice<T>&&) = default; + ArraySlice(ArraySlice<T>&&) noexcept = default; ArraySlice<T>& operator=(const ArraySlice<T>&) = default; - ArraySlice<T>& operator=(ArraySlice<T>&&) = default; + ArraySlice<T>& operator=(ArraySlice<T>&&) noexcept = default; // Iterators. iterator begin() { return iterator(&AtUnchecked(0), element_size_); } diff --git a/libartbase/base/stride_iterator.h b/libartbase/base/stride_iterator.h index 67c0d3803e..6a7e4bef67 100644 --- a/libartbase/base/stride_iterator.h +++ b/libartbase/base/stride_iterator.h @@ -30,9 +30,9 @@ class StrideIterator : public std::iterator<std::random_access_iterator_tag, T> typename std::iterator<std::random_access_iterator_tag, T>::difference_type; StrideIterator(const StrideIterator&) = default; - StrideIterator(StrideIterator&&) = default; + StrideIterator(StrideIterator&&) noexcept = default; StrideIterator& operator=(const StrideIterator&) = default; - StrideIterator& operator=(StrideIterator&&) = default; + StrideIterator& operator=(StrideIterator&&) noexcept = default; StrideIterator(T* ptr, size_t stride) : ptr_(reinterpret_cast<uintptr_t>(ptr)), diff --git a/openjdkjvmti/art_jvmti.h b/openjdkjvmti/art_jvmti.h index 083ba6ddf1..cdda09b9e7 100644 --- a/openjdkjvmti/art_jvmti.h +++ b/openjdkjvmti/art_jvmti.h @@ -141,7 +141,7 @@ class JvmtiDeleter { explicit JvmtiDeleter(jvmtiEnv* env) : env_(env) {} JvmtiDeleter(JvmtiDeleter&) = default; - JvmtiDeleter(JvmtiDeleter&&) = default; + JvmtiDeleter(JvmtiDeleter&&) noexcept = default; JvmtiDeleter& operator=(const JvmtiDeleter&) = default; void operator()(T* ptr) const { @@ -161,7 +161,7 @@ class JvmtiDeleter<T[]> { explicit JvmtiDeleter(jvmtiEnv* env) : env_(env) {} JvmtiDeleter(JvmtiDeleter&) = default; - JvmtiDeleter(JvmtiDeleter&&) = default; + JvmtiDeleter(JvmtiDeleter&&) noexcept = default; JvmtiDeleter& operator=(const JvmtiDeleter&) = default; template <typename U> diff --git a/openjdkjvmti/ti_redefine.h b/openjdkjvmti/ti_redefine.h index 85b1070516..cdd662787c 100644 --- a/openjdkjvmti/ti_redefine.h +++ b/openjdkjvmti/ti_redefine.h @@ -126,7 +126,7 @@ class Redefiner { ~ClassRedefinition() NO_THREAD_SAFETY_ANALYSIS; // Move assignment so we can sort these in a vector. - ClassRedefinition& operator=(ClassRedefinition&& other) { + ClassRedefinition& operator=(ClassRedefinition&& other) noexcept { driver_ = other.driver_; klass_ = other.klass_; dex_file_ = std::move(other.dex_file_); @@ -138,7 +138,7 @@ class Redefiner { } // Move constructor so we can put these into a vector. - ClassRedefinition(ClassRedefinition&& other) + ClassRedefinition(ClassRedefinition&& other) noexcept : driver_(other.driver_), klass_(other.klass_), dex_file_(std::move(other.dex_file_)), diff --git a/runtime/jit/jit.cc b/runtime/jit/jit.cc index 91869c6175..2deed43982 100644 --- a/runtime/jit/jit.cc +++ b/runtime/jit/jit.cc @@ -751,7 +751,7 @@ void Jit::NotifyZygoteCompilationDone() { class ScopedCompilation { public: - ScopedCompilation(ScopedCompilation&& other) : + ScopedCompilation(ScopedCompilation&& other) noexcept : jit_(other.jit_), method_(other.method_), compilation_kind_(other.compilation_kind_), diff --git a/test/ti-agent/scoped_utf_chars.h b/test/ti-agent/scoped_utf_chars.h index 422caaf84e..ddf1bd58f5 100644 --- a/test/ti-agent/scoped_utf_chars.h +++ b/test/ti-agent/scoped_utf_chars.h @@ -38,7 +38,7 @@ class ScopedUtfChars { } } - ScopedUtfChars(ScopedUtfChars&& rhs) : + ScopedUtfChars(ScopedUtfChars&& rhs) noexcept : env_(rhs.env_), string_(rhs.string_), utf_chars_(rhs.utf_chars_) { rhs.env_ = nullptr; rhs.string_ = nullptr; @@ -51,7 +51,7 @@ class ScopedUtfChars { } } - ScopedUtfChars& operator=(ScopedUtfChars&& rhs) { + ScopedUtfChars& operator=(ScopedUtfChars&& rhs) noexcept { if (this != &rhs) { // Delete the currently owned UTF chars. this->~ScopedUtfChars(); |