1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: no-exceptions
19 explicit B(int id
) : id_(id
) {count
++;}
20 B(const B
& a
) : id_(a
.id_
) {count
++;}
31 explicit A(int id
) : B(id
-1), id_(id
) {count
++;}
32 A(const A
& a
) : B(a
.id_
-1), id_(a
.id_
) {count
++;}
40 assert(A::count
== 0);
41 assert(B::count
== 0);
43 assert(A::count
== 1);
44 assert(B::count
== 1);
53 assert(A::count
== 0);
59 assert(A::count
!= 0);
60 assert(B::count
!= 0);
79 assert(B::count
!= 0);
82 assert(A::count
== 0);
83 assert(B::count
== 0);