view gcc/testsuite/g++.dg/opt/pr78901.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// PR middle-end/78901
// { dg-do compile }
// { dg-options "-O2 -Wno-stringop-overflow" }

extern "C" int __snprintf_chk (char *, __SIZE_TYPE__, int, __SIZE_TYPE__, const char *, ...);

int
foo (char *c)
{
  try
    {
      return __snprintf_chk (c, 64, 0, 32, "%s", "abcdefghijklmnopq");
    }
  catch (...)
    {
      return -1;
    }
}