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 unique_ptr converting move assignment
16 // Can't assign from lvalue
20 #include "test_macros.h"
21 #include "../../deleter.h"
33 // Can't assign from lvalue
37 std::unique_ptr<B, Deleter<B>& > s(new B, db);
39 std::unique_ptr<A, Deleter<A> &> s2(new A, da);
40 #if TEST_STD_VER >= 11
41 s2 = s; // expected-error {{no viable overloaded '='}}
43 // NOTE: The move-semantic emulation creates an ambiguous overload set
44 // so that assignment from an lvalue does not compile
45 s2 = s; // expected-error {{use of overloaded operator '=' is ambiguous}}