Fix broken MinGW build of gcc.c
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / crash15.C
blobc4af169a299dd79f0843a9b285ef154ebc9fad02
1 // { dg-do assemble  }
2 // { dg-options "-O2" }
3 // g++ crashed because we unsaved the TARGET_EXPR for the return value
4 // for get_allocator without first expanding it, because it was part of the
5 // cleanup for the temporary string.
7 // Derived from libstdc++ v3 code.
10 class AA {};
12 void fee (const AA&);
14 class basic_string
16 public:
17   basic_string(const char*);
19   ~basic_string() 
20   { fee (this->get_allocator()); }
22   AA get_allocator();
25 class failure
27 public:
28   failure(const basic_string& __str);
31 class foo
33 public:
34   foo(int x)
35   {
36     throw failure ("");
37   }
40 void test05()
42   foo ofs(0);