[libc++] Avoid using GNU extension in test, which triggers a warning
authorLouis Dionne <ldionne@apple.com>
Fri, 1 May 2020 15:04:34 +0000 (11:04 -0400)
committerLouis Dionne <ldionne@apple.com>
Fri, 1 May 2020 15:10:06 +0000 (11:10 -0400)
libcxx/test/libcxx/atomics/atomics.align/align.pass.sh.cpp

index 1b2eebc..835475e 100644 (file)
 #include <atomic>
 #include <cassert>
 
-template <typename T> struct atomic_test : public std::__atomic_base<T> {
+template <typename T>
+struct atomic_test : public std::__atomic_base<T> {
   atomic_test() {
-    if (this->is_lock_free())
-      assert(alignof(this->__a_) >= sizeof(this->__a_) &&
+    if (this->is_lock_free()) {
+      using AtomicImpl = decltype(this->__a_);
+      assert(alignof(AtomicImpl) >= sizeof(AtomicImpl) &&
              "expected natural alignment for lock-free type");
+    }
   }
 };