From 063dfcdd5a91bea164f6c65ef5e41a366d80bc16 Mon Sep 17 00:00:00 2001 From: Android Tools Maintainers Date: Thu, 13 Dec 2018 09:11:09 +0000 Subject: [PATCH] Conforms with the exception specification of `std::atomic` All constructors of `std::atomic` require `noexcept`. As a result, its members must also be able to instantiate without any exception throwing. Gbp-Pq: Name atomic-exception-specification.patch --- runtime/gc_root.h | 2 +- runtime/mirror/dex_cache.h | 4 ++-- runtime/mirror/object_reference.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/gc_root.h b/runtime/gc_root.h index 0894e9b..e860d81 100644 --- a/runtime/gc_root.h +++ b/runtime/gc_root.h @@ -212,7 +212,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/runtime/mirror/dex_cache.h b/runtime/mirror/dex_cache.h index 7fd5dd1..a80faae 100644 --- a/runtime/mirror/dex_cache.h +++ b/runtime/mirror/dex_cache.h @@ -65,7 +65,7 @@ template struct PACKED(8) DexCachePair { DexCachePair(ObjPtr object, uint32_t index) : object(object), index(index) {} - DexCachePair() : index(0) {} + DexCachePair() noexcept : index(0) {} DexCachePair(const DexCachePair&) = default; DexCachePair& operator=(const DexCachePair&) = default; @@ -99,7 +99,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/runtime/mirror/object_reference.h b/runtime/mirror/object_reference.h index a96a120..5880221 100644 --- a/runtime/mirror/object_reference.h +++ b/runtime/mirror/object_reference.h @@ -109,7 +109,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