gcc/testsuite/g++.old-deja/g++.jason/temporary.C
raw| 1 | // { dg-do run } |
| 2 | // From: [email protected] (Bruno R. Depascale) |
| 3 | // Subject: No destructor bug |
| 4 | // Date: Mon, 14 Feb 1994 12:49:45 -0300 (Arg) |
| 5 | |
| 6 | // Bug: temporaries created with constructor notation aren't destroyed. |
| 7 | |
| 8 | int count = 0; |
| 9 | |
| 10 | class A { |
| 11 | public: |
| 12 | A() { ++count; } |
| 13 | ~A() { --count; } |
| 14 | }; |
| 15 | |
| 16 | int main() |
| 17 | { |
| 18 | A(); |
| 19 | return count; |
| 20 | } |