Skip to content

Commit 9295f35

Browse files
committed
[libc++] Avoid using GNU extension in test, which triggers a warning
1 parent 0c91e13 commit 9295f35

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,14 @@
2828
#include <atomic>
2929
#include <cassert>
3030

31-
template <typename T> struct atomic_test : public std::__atomic_base<T> {
31+
template <typename T>
32+
struct atomic_test : public std::__atomic_base<T> {
3233
atomic_test() {
33-
if (this->is_lock_free())
34-
assert(alignof(this->__a_) >= sizeof(this->__a_) &&
34+
if (this->is_lock_free()) {
35+
using AtomicImpl = decltype(this->__a_);
36+
assert(alignof(AtomicImpl) >= sizeof(AtomicImpl) &&
3537
"expected natural alignment for lock-free type");
38+
}
3639
}
3740
};
3841

0 commit comments

Comments
 (0)