1 //===----------------------------------------------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 // enum class align_val_t : size_t {}
11
12 // UNSUPPORTED: c++98, c++03, c++11, c++14
13
14 #include <new>
15
16 #include "test_macros.h"
17
main()18 int main() {
19 {
20 static_assert(std::is_enum<std::align_val_t>::value, "");
21 static_assert(std::is_same<std::underlying_type<std::align_val_t>::type, std::size_t>::value, "");
22 static_assert(!std::is_constructible<std::align_val_t, std::size_t>::value, "");
23 static_assert(!std::is_constructible<std::size_t, std::align_val_t>::value, "");
24 }
25 {
26 constexpr auto a = std::align_val_t(0);
27 constexpr auto b = std::align_val_t(32);
28 constexpr auto c = std::align_val_t(-1);
29 static_assert(a != b, "");
30 static_assert(a == std::align_val_t(0), "");
31 static_assert(b == std::align_val_t(32), "");
32 static_assert(static_cast<std::size_t>(c) == (std::size_t)-1, "");
33 }
34 }
35