From 1e31a3a4b1d9fc3269a4e4811230e6703cd3f57c Mon Sep 17 00:00:00 2001 From: Android Tools Maintainers Date: Wed, 11 Jan 2023 08:19:44 +0000 Subject: [PATCH] Conforms with the exception specification of `std::atomic` Forwarded: not-needed All constructors of `std::atomic` require `noexcept`. As a result, its members must also be able to instantiate without any exception throwing. Gbp-Pq: Topic art Gbp-Pq: Name atomic-exception-specification.patch --- art/runtime/gc_root.h | 2 +- art/runtime/mirror/dex_cache.h | 4 ++-- art/runtime/mirror/object_reference.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/art/runtime/gc_root.h b/art/runtime/gc_root.h index 8d8c32ce..358417dd 100644 --- a/art/runtime/gc_root.h +++ b/art/runtime/gc_root.h @@ -214,7 +214,7 @@ class GcRoot { return root_.IsNull(); } - ALWAYS_INLINE GcRoot() {} + ALWAYS_INLINE GcRoot() noexcept {} explicit ALWAYS_INLINE GcRoot(MirrorType* ref) REQUIRES_SHARED(Locks::mutator_lock_); explicit ALWAYS_INLINE GcRoot(ObjPtr ref) diff --git a/art/runtime/mirror/dex_cache.h b/art/runtime/mirror/dex_cache.h index 292db145..51ae22fd 100644 --- a/art/runtime/mirror/dex_cache.h +++ b/art/runtime/mirror/dex_cache.h @@ -69,7 +69,7 @@ template struct PACKED(8) DexCachePair { // Set the initial state for the 0th entry to be {0,1} which is guaranteed to fail // the lookup id == stored id branch. DexCachePair(ObjPtr object, uint32_t index); - DexCachePair() : index(0) {} + DexCachePair() noexcept : index(0) {} DexCachePair(const DexCachePair&) = default; DexCachePair& operator=(const DexCachePair&) = default; @@ -92,7 +92,7 @@ template struct PACKED(2 * __SIZEOF_POINTER__) NativeDexCachePair { NativeDexCachePair(T* object, uint32_t index) : object(object), index(index) {} - NativeDexCachePair() : object(nullptr), index(0u) { } + NativeDexCachePair() noexcept : object(nullptr), index(0u) { } NativeDexCachePair(const NativeDexCachePair&) = default; NativeDexCachePair& operator=(const NativeDexCachePair&) = default; diff --git a/art/runtime/mirror/object_reference.h b/art/runtime/mirror/object_reference.h index f01bcbd8..3d92f91a 100644 --- a/art/runtime/mirror/object_reference.h +++ b/art/runtime/mirror/object_reference.h @@ -164,7 +164,7 @@ static_assert(sizeof(mirror::HeapReference) == kHeapReferenceSiz template class MANAGED CompressedReference : public mirror::ObjectReference { public: - CompressedReference() REQUIRES_SHARED(Locks::mutator_lock_) + CompressedReference() noexcept REQUIRES_SHARED(Locks::mutator_lock_) : mirror::ObjectReference(nullptr) {} static CompressedReference FromMirrorPtr(MirrorType* p) -- 2.30.2