Skip to content

Commit

Permalink
[libc++] Avoid using GNU extension in test, which triggers a warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ldionne committed May 1, 2020
1 parent 0c91e13 commit 9295f35
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions libcxx/test/libcxx/atomics/atomics.align/align.pass.sh.cpp
Expand Up @@ -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");
}
}
};

Expand Down

0 comments on commit 9295f35

Please sign in to comment.