| 1 |
// PR rtl-optimization/85393 |
| 2 |
// { dg-do run { target c++11 } } |
| 3 |
// { dg-options "-O2" } |
| 4 |
// { dg-additional-sources "pr85393-aux.cc" } |
| 5 |
// { dg-skip-if "requires hosted libstdc++ for stdexcept" { ! hostedlib } } |
| 6 |
|
| 7 |
#include <stdexcept> |
| 8 |
#include <vector> |
| 9 |
|
| 10 |
void foo (char const *s); |
| 11 |
struct S { ~S () noexcept (false) { throw std::runtime_error ("foo"); } }; |
| 12 |
|
| 13 |
int |
| 14 |
main (int argc, char *argv[]) |
| 15 |
{ |
| 16 |
std::vector <std::vector <char> > args; |
| 17 |
try |
| 18 |
{ |
| 19 |
{ |
| 20 |
S k; |
| 21 |
foo ("A"); |
| 22 |
} |
| 23 |
|
| 24 |
if (argv) |
| 25 |
throw std::runtime_error ("foo"); |
| 26 |
args.push_back ({}); |
| 27 |
} |
| 28 |
catch (std::runtime_error const& e) |
| 29 |
{} |
| 30 |
} |