blob: 56ab43c7de24659a5060fa860b9ed49ead6b6d0a [file] [log] [blame]
Howard Hinnantc52f43e2010-08-22 00:59:46 +00001//===----------------------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
Howard Hinnantb64f8b02010-11-16 22:09:02 +00005// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
Howard Hinnantc52f43e2010-08-22 00:59:46 +00007//
8//===----------------------------------------------------------------------===//
9
10// <memory>
11
12// unique_ptr
13
14// Test unique_ptr converting move assignment
15
16// Do not convert from an array unique_ptr
17
18#include <memory>
Marshall Clow6b913d72015-01-09 20:25:52 +000019#include <utility>
Howard Hinnantc52f43e2010-08-22 00:59:46 +000020#include <cassert>
21
22struct A
23{
24};
25
26struct Deleter
27{
28 void operator()(void*) {}
29};
30
31int main()
32{
33 std::unique_ptr<A[], Deleter> s;
34 std::unique_ptr<A, Deleter> s2;
Dan Albert1d4a1ed2016-05-25 22:36:09 -070035 s2 = std::move(s);
Howard Hinnantc52f43e2010-08-22 00:59:46 +000036}