Debian Codegraph @

gcc/testsuite/g++.dg/torture/pr40642.C

raw
1 // { dg-do compile }
2 /* { dg-require-profiling "-fprofile-generate" } */
3 // { dg-options "-fprofile-generate" }
4
5 // GCC used to ICE with some EH edge missing.
6
7 inline void* operator new(__SIZE_TYPE__, void* p) throw() { return p; }
8 inline void operator delete (void*, void*) throw() { }
9
10 template<typename T> void foo(void* p, T t)
11 {
12 new(p) T(t);
13 }
14
15 void bar();
16
17 template<typename T> struct A
18 {
19 T* p;
20
21 A() { try { foo(p, T()); } catch(...) {} }
22
23 A(const A&) { try { bar(); } catch(...) { throw; } }
24 };
25
26 A<A<int> > a;
27