libcxx

libcxx mirror with random patches
git clone https://git.neptards.moe/neptards/libcxx.git
Log | Files | Refs

c1xx_broken_is_trivially_copyable.pass.cpp (974B)


      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 // UNSUPPORTED: c++98, c++03
     11 
     12 // This workaround option is specific to MSVC's C1XX, so we don't care that
     13 // it isn't set for older GCC versions.
     14 // XFAIL: gcc-4.9
     15 
     16 // Verify TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE.
     17 
     18 #include <type_traits>
     19 
     20 #include "test_workarounds.h"
     21 
     22 struct S {
     23   S(S const&) = default;
     24   S(S&&) = default;
     25   S& operator=(S const&) = delete;
     26   S& operator=(S&&) = delete;
     27 };
     28 
     29 int main() {
     30 #if defined(TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE)
     31   static_assert(!std::is_trivially_copyable<S>::value, "");
     32 #else
     33   static_assert(std::is_trivially_copyable<S>::value, "");
     34 #endif
     35 }