summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/opt/pr47280.C
blob: 01ca4843978fbcf4904082a954b1f65df0676320 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// { dg-do compile }
// { dg-options "-O -fnon-call-exceptions -ftrapv" }

void bar (int n, char *p)
{
  try
    {
      n++;
      for (int i = 0; i < n - 1; i++)
	p[i];
    }
  catch (...)
    {}
}