1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 #include <test_macros.h>
13 // UNSUPPORTED: c++98, c++03, c++11, c++14
14 // The following compilers don't like "std::byte b1{1}"
15 // UNSUPPORTED: clang-3.5, clang-3.6, clang-3.7, clang-3.8
16 // UNSUPPORTED: apple-clang-6, apple-clang-7, apple-clang-8.0
18 // constexpr byte operator~(byte b) noexcept;
21 constexpr std::byte b1{1};
22 constexpr std::byte b2{2};
23 constexpr std::byte b8{8};
25 static_assert(noexcept(~b1), "" );
27 static_assert(std::to_integer<int>(~b1) == 254, "");
28 static_assert(std::to_integer<int>(~b2) == 253, "");
29 static_assert(std::to_integer<int>(~b8) == 247, "");