diff options
Diffstat (limited to 'test/std/depr/depr.auto.ptr/auto.ptr/A.h')
-rw-r--r-- | test/std/depr/depr.auto.ptr/auto.ptr/A.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/std/depr/depr.auto.ptr/auto.ptr/A.h b/test/std/depr/depr.auto.ptr/auto.ptr/A.h new file mode 100644 index 000000000000..cc16abe06d72 --- /dev/null +++ b/test/std/depr/depr.auto.ptr/auto.ptr/A.h @@ -0,0 +1,30 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef A_H +#define A_H + +#include <cassert> + +class A +{ + int id_; +public: + explicit A(int id) : id_(id) {++count;} + A(const A& a) : id_(a.id_) {++count;} + ~A() {assert(id_ >= 0); id_ = -1; --count;} + + int id() const {return id_;} + + static int count; +}; + +int A::count = 0; + +#endif // A_H |