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
10 // REQUIRES: c++03 || c++11 || c++14
15 #pragma GCC diagnostic ignored "-Wunreachable-code"
16 #pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated
24 ~A() {assert(id_
== count
--);}
28 A
& operator=(const A
&);
38 ~B() {assert(id_
== count
--);}
42 B
& operator=(const B
&);
52 ~C() {assert(id_
== count
--);}
56 C
& operator=(const C
&);
69 void f1() throw (long, char, int, double)
100 assert(A::count
== 0);
101 assert(B::count
== 0);
102 assert(C::count
== 0);