Conforms with the exception specification of `std::atomic`
authorAndroid Tools Maintainers <android-tools-devel@lists.alioth.debian.org>
Tue, 31 Jan 2023 07:58:29 +0000 (07:58 +0000)
committerRoger Shimizu <rosh@debian.org>
Tue, 31 Jan 2023 07:58:29 +0000 (07:58 +0000)
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
art/runtime/mirror/dex_cache.h
art/runtime/mirror/object_reference.h

index 8d8c32ce1635b0c2d2003b5af4a5381ddd8f3ced..358417dd1a4f79858e7646208fff888825bdef6c 100644 (file)
@@ -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<MirrorType> ref)
index 292db14587268218d9809d617d969e9bdee6baa6..51ae22fdd1199e90aeca8d3a161d75667d699a4b 100644 (file)
@@ -69,7 +69,7 @@ template <typename T> 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<T> object, uint32_t index);
-  DexCachePair() : index(0) {}
+  DexCachePair() noexcept : index(0) {}
   DexCachePair(const DexCachePair<T>&) = default;
   DexCachePair& operator=(const DexCachePair<T>&) = default;
 
@@ -92,7 +92,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 f01bcbd83ae4b895782cd87d6fe27dc488febc58..3d92f91ae26ad763e7105f0321a038bfa2de30bf 100644 (file)
@@ -164,7 +164,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)