diff --git a/test/std/language.support/support.types/byteops/enum_direct_init.pass.cpp b/test/std/language.support/support.types/byteops/enum_direct_init.pass.cpp new file mode 100644 index 000000000..157626137 --- /dev/null +++ b/test/std/language.support/support.types/byteops/enum_direct_init.pass.cpp @@ -0,0 +1,21 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include +#include + +// UNSUPPORTED: c++98, c++03, c++11, c++14 +// The following compilers don't like "std::byte b1{1}" +// XFAIL: clang-3.5, clang-3.6, clang-3.7, clang-3.8 +// XFAIL: apple-clang-6, apple-clang-7, apple-clang-8.0 + +int main () { + constexpr std::byte b{42}; + static_assert(std::to_integer(b) == 42, ""); +}