diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/cleanup2.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/cleanup2.C | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cleanup2.C b/gcc/testsuite/g++.old-deja/g++.other/cleanup2.C new file mode 100644 index 000000000..976b86411 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/cleanup2.C @@ -0,0 +1,27 @@ +// { dg-do run } +// { dg-options "-O -fno-exceptions -w" } +// Origin: Bryan Scattergood <bryan@fsel.com> + +extern "C" void abort(); + +class A +{ +public: + A(); + ~A(); + int foo(); +}; + +A::A() {} +A::~A() { abort (); } +int A::foo() {} + +extern int f() +{ + return 0; +} + +int main() +{ + return ((f() != 0) ? A().foo() : 0); +} |