Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / ubsan / pr105729.C
blobfb6766309948615a36f1fbf508876828512deedb
1 // PR sanitizer/105729
2 // { dg-do run }
3 // { dg-options "-fsanitize=null -fno-sanitize-recover=null" }
5 int
6 foo (int x)
8   throw 0;
11 struct S {};
12 struct T {
13   S *data;
14   T () : data (0) {}
15   const S &bar (int x) const { return data[foo (x)]; }
18 int
19 main ()
21   T t;
22   try
23     {
24       t.bar (-1);
25     }
26   catch (...)
27     {
28     }