default.pass.cpp revision bc8d3f97eb5c958007f2713238472e0c1c8fe02c
1//===----------------------------------------------------------------------===//
2//
3// ��������������������The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// <memory>
11
12// default_delete
13
14#include <memory>
15#include <cassert>
16
17struct A
18{
19    static int count;
20    A() {++count;}
21    A(const A&) {++count;}
22    ~A() {--count;}
23};
24
25int A::count = 0;
26
27int main()
28{
29    std::default_delete<A> d;
30    A* p = new A;
31    assert(A::count == 1);
32    d(p);
33    assert(A::count == 0);
34}
35