Home | History | Annotate | Download | only in support.types
      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 #include <cstddef>
     11 #include <type_traits>
     12 #include <test_macros.h>
     13 
     14 // XFAIL: c++98, c++03, c++11, c++14
     15 
     16 // std::byte is not an integer type, nor a character type.
     17 // It is a distinct type for accessing the bits that ultimately make up object storage.
     18 
     19 static_assert( std::is_pod<std::byte>::value, "" );
     20 static_assert(!std::is_arithmetic<std::byte>::value, "" );
     21 static_assert(!std::is_integral<std::byte>::value, "" );
     22 
     23 static_assert(!std::is_same<std::byte,          char>::value, "" );
     24 static_assert(!std::is_same<std::byte,   signed char>::value, "" );
     25 static_assert(!std::is_same<std::byte, unsigned char>::value, "" );
     26 
     27 // The standard doesn't outright say this, but it's pretty clear that it has to be true.
     28 static_assert(sizeof(std::byte) == 1, "" );
     29 
     30 int main () {}
     31