diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/torture/pr33572.C | 34 |
2 files changed, 12 insertions, 27 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 17060ee..0b1e916 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-10-08 Alexandre Oliva <aoliva@redhat.com> + + PR tree-optimization/33572 + * g++.dg/torture/pr33572.C: Replace with complete test. + 2007-10-08 Tobias Schlüter <tobi@gcc.gnu.org> PR fortran/33689 diff --git a/gcc/testsuite/g++.dg/torture/pr33572.C b/gcc/testsuite/g++.dg/torture/pr33572.C index 27557cd..096db08 100644 --- a/gcc/testsuite/g++.dg/torture/pr33572.C +++ b/gcc/testsuite/g++.dg/torture/pr33572.C @@ -1,36 +1,16 @@ // { dg-do run } -namespace __gnu_cxx { - template<bool> struct __pool { - void _M_reclaim_block(char* p, unsigned long bytes); - }; -} - -struct vector { - ~vector() { deallocate(0); } - void deallocate(int* p) { - if (p) { - static __gnu_cxx::__pool<true> pool; - pool._M_reclaim_block((char*)0, 0); - } - } -}; - -struct Foo { virtual void f() { } }; +#include <vector> +#include <memory> -struct auto_ptr { - Foo* ptr; - auto_ptr() : ptr(0) { } - ~auto_ptr() { delete ptr; } - Foo* release() { Foo* tmp = ptr; ptr = 0; return tmp; } - void reset(Foo* p) { ptr = p; } -}; +struct Foo { virtual void f() {} }; -int main(int argc, char**) { - auto_ptr foo; +int main(int argc, char**) +{ + std::auto_ptr<Foo> foo; if (argc) { foo.reset(new Foo()); } else { - vector v; + std::vector<int> v; } Foo* p = foo.release(); p->f(); |