diff options
author | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-09-20 20:05:00 +0000 |
---|---|---|
committer | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-09-20 20:05:00 +0000 |
commit | 011f4269d12baf61a3cd362d98a83bfc7dae9d2a (patch) | |
tree | ee735cfa14ff6a5dc80e37e189c52b79327d6946 | |
parent | 2a237206d302801bb61622528afd4905ecaab89e (diff) | |
download | gcc-011f4269d12baf61a3cd362d98a83bfc7dae9d2a.tar.gz |
2009-09-20 Andrew Pinski <pinskia@gcc.gnu.org>
PR middle-end/40642
* g++.dg/torture/pr40642.C: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151907 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/torture/pr40642.C | 26 |
2 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 127d213d799..5dd2a729c1f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-09-20 Andrew Pinski <pinskia@gcc.gnu.org> + + PR middle-end/40642 + * g++.dg/torture/pr40642.C: New testcase. + 2009-09-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * gcc.dg/torture/builtin-math-7.c: Update for testing Annex G diff --git a/gcc/testsuite/g++.dg/torture/pr40642.C b/gcc/testsuite/g++.dg/torture/pr40642.C new file mode 100644 index 00000000000..3f545a89037 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr40642.C @@ -0,0 +1,26 @@ +// { dg-do compile } +// { dg-options "-fprofile-generate" } + +// GCC used to ICE with some EH edge missing. + +inline void* operator new(__SIZE_TYPE__, void* p) throw() { return p; } +inline void operator delete (void*, void*) throw() { } + +template<typename T> void foo(void* p, T t) +{ + new(p) T(t); +} + +void bar(); + +template<typename T> struct A +{ + T* p; + + A() { try { foo(p, T()); } catch(...) {} } + + A(const A&) { try { bar(); } catch(...) { throw; } } +}; + +A<A<int> > a; + |