2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / opt / pr85393.C
bloba2a3162300eaf274f1475cd927fe7460687fbe61
1 // PR rtl-optimization/85393
2 // { dg-do run { target c++11 } }
3 // { dg-options "-O2" }
4 // { dg-additional-sources "pr85393-aux.cc" }
6 #include <stdexcept>
7 #include <vector>
9 void foo (char const *s);
10 struct S { ~S () noexcept (false) { throw std::runtime_error ("foo"); } };
12 int
13 main (int argc, char *argv[])
15   std::vector <std::vector <char> > args;
16   try
17     {
18       {
19         S k;
20         foo ("A");
21       }
23       if (argv)
24         throw std::runtime_error ("foo");
25       args.push_back ({});
26     }
27   catch (std::runtime_error const& e)
28     {}