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 // <memory> 11 12 // unique_ptr 13 14 // Test unique_ptr move assignment 15 16 #include <memory> 17 18 #include "test_macros.h" 19 20 int main() 21 { 22 std::unique_ptr<int> s, s2; 23 #if TEST_STD_VER >= 11 24 s2 = s; // expected-error {{cannot be assigned because its copy assignment operator is implicitly deleted}} 25 #else 26 s2 = s; // expected-error {{'operator=' is a private member of 'std::__1::unique_ptr}} 27 #endif 28 } 29