Conforms with the exception specification of `std::atomic`
authorAndroid Tools Maintainers <android-tools-devel@lists.alioth.debian.org>
Tue, 19 Mar 2019 01:46:21 +0000 (01:46 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Tue, 19 Mar 2019 01:46:21 +0000 (01:46 +0000)
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
runtime/mirror/dex_cache.h
runtime/mirror/object_reference.h

index 0894e9bee5397bcb9c720d8ba916fae785cfaded..e860d81bec06cdffe1fb3cd0309c77db11f47e43 100644 (file)
@@ -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<MirrorType> ref)
index 7fd5dd104c52441d4e9808d7bdb28d5d2dc85ccc..a80faaeb07ad7ac21d71916cadbb4957afb3d2ad 100644 (file)
@@ -65,7 +65,7 @@ template <typename T> struct PACKED(8) DexCachePair {
   DexCachePair(ObjPtr<T> object, uint32_t index)
       : object(object),
         index(index) {}
-  DexCachePair() : index(0) {}
+  DexCachePair() noexcept : index(0) {}
   DexCachePair(const DexCachePair<T>&) = default;
   DexCachePair& operator=(const DexCachePair<T>&) = default;
 
@@ -99,7 +99,7 @@ template <typename T> 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<T>&) = default;
   NativeDexCachePair& operator=(const NativeDexCachePair<T>&) = default;
 
index a96a120d68bf1c53d8e9613c0ddf6160825190e1..58802216484e88a691282ea04958c32c05805ad1 100644 (file)
@@ -109,7 +109,7 @@ static_assert(sizeof(mirror::HeapReference<mirror::Object>) == kHeapReferenceSiz
 template<class MirrorType>
 class MANAGED CompressedReference : public mirror::ObjectReference<false, MirrorType> {
  public:
-  CompressedReference<MirrorType>() REQUIRES_SHARED(Locks::mutator_lock_)
+  CompressedReference<MirrorType>() noexcept REQUIRES_SHARED(Locks::mutator_lock_)
       : mirror::ObjectReference<false, MirrorType>(nullptr) {}
 
   static CompressedReference<MirrorType> FromMirrorPtr(MirrorType* p)