view gcc/testsuite/g++.dg/opt/pr85393.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +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)
    {}
}