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 //===----------------------------------------------------------------------===//
14 // Test that reference wrapper meets the requirements of TriviallyCopyable,
15 // CopyConstructible and CopyAssignable.
17 // Test fails due to use of is_trivially_* trait.
21 #include <type_traits>
24 #include "test_macros.h"
26 #if TEST_STD_VER >= 11
29 MoveOnly(const MoveOnly&);
30 MoveOnly& operator=(const MoveOnly&);
34 MoveOnly(int data = 1) : data_(data) {}
35 MoveOnly(MoveOnly&& x)
36 : data_(x.data_) {x.data_ = 0;}
37 MoveOnly& operator=(MoveOnly&& x)
38 {data_ = x.data_; x.data_ = 0; return *this;}
40 int get() const {return data_;}
48 typedef std::reference_wrapper<T> Wrap;
49 static_assert(std::is_copy_constructible<Wrap>::value, "");
50 static_assert(std::is_copy_assignable<Wrap>::value, "");
51 // Extension up for standardization: See N4151.
52 static_assert(std::is_trivially_copyable<Wrap>::value, "");
60 #if TEST_STD_VER >= 11