[libcxx-commits] [libcxx] 9295f35 - [libc++] Avoid using GNU extension in test, which triggers a warning

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 1 08:11:51 PDT 2020


Author: Louis Dionne
Date: 2020-05-01T11:10:06-04:00
New Revision: 9295f356bb30f283219b3fd32542f0096cfb9316

URL: https://github.com/llvm/llvm-project/commit/9295f356bb30f283219b3fd32542f0096cfb9316
DIFF: https://github.com/llvm/llvm-project/commit/9295f356bb30f283219b3fd32542f0096cfb9316.diff

LOG: [libc++] Avoid using GNU extension in test, which triggers a warning

Added: 
    

Modified: 
    libcxx/test/libcxx/atomics/atomics.align/align.pass.sh.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/libcxx/atomics/atomics.align/align.pass.sh.cpp b/libcxx/test/libcxx/atomics/atomics.align/align.pass.sh.cpp
index 1b2eebcb7ea8..835475e10a83 100644
--- a/libcxx/test/libcxx/atomics/atomics.align/align.pass.sh.cpp
+++ b/libcxx/test/libcxx/atomics/atomics.align/align.pass.sh.cpp
@@ -28,11 +28,14 @@
 #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");
+    }
   }
 };
 


        


More information about the libcxx-commits mailing list