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