view gcc/testsuite/g++.dg/opt/pr85393.C @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 84e7813d76e9
children
line wrap: on
line source

// PR rtl-optimization/85393
// { dg-do run { target c++11 } }
// { dg-options "-O2" }
// { dg-additional-sources "pr85393-aux.cc" }

#include <stdexcept>
#include <vector>

void foo (char const *s);
struct S { ~S () noexcept (false) { throw std::runtime_error ("foo"); } };

int
main (int argc, char *argv[])
{
  std::vector <std::vector <char> > args;
  try
    {
      {
        S k;
        foo ("A");
      }

      if (argv)
        throw std::runtime_error ("foo");
      args.push_back ({});
    }
  catch (std::runtime_error const& e)
    {}
}