// // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 // static constexpr size_t required_alignment; #include #include #include #include template constexpr void check_required_alignment() { std::same_as decltype(auto) required_alignment = std::atomic_ref::required_alignment; assert(required_alignment >= alignof(T)); } constexpr bool test() { check_required_alignment(); check_required_alignment(); check_required_alignment(); struct Empty {}; check_required_alignment(); struct Trivial { int a; }; check_required_alignment(); return true; } int main(int, char**) { test(); static_assert(test()); return 0; }