From 9295f356bb30f283219b3fd32542f0096cfb9316 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Fri, 1 May 2020 11:04:34 -0400 Subject: [PATCH] [libc++] Avoid using GNU extension in test, which triggers a warning --- libcxx/test/libcxx/atomics/atomics.align/align.pass.sh.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 1b2eebc..835475e 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 #include -template struct atomic_test : public std::__atomic_base { +template +struct atomic_test : public std::__atomic_base { 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"); + } } }; -- 2.7.4