//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <memory>
// unique_ptr
// Test default unique_ptr<T[]> ctor
// default unique_ptr<T[]> ctor shouldn't require complete type
#include<memory>#include<cassert>structA;classDeleter{intstate_;Deleter(Deleter&);Deleter&operator=(Deleter&);public:Deleter():state_(5){}intstate()const{returnstate_;}voidoperator()(A*p);};voidcheck(inti);template<classD=std::default_delete<A>>structB{std::unique_ptr<A[],D>a_;B();~B();A*get()const{returna_.get();}D&get_deleter(){returna_.get_deleter();}};intmain(){{B<>s;assert(s.get()==0);}check(0);{B<Deleter>s;assert(s.get()==0);assert(s.get_deleter().state()==5);}check(0);}structA{staticintcount;A(){++count;}A(constA&){++count;}~A(){--count;}};intA::count=0;voidDeleter::operator()(A*p){deletep;}voidcheck(inti){assert(A::count==i);}template<classD>B<D>::B(){}template<classD>B<D>::~B(){}