gcc/testsuite/g++.dg/torture/pr111245.C
raw| 1 | /* { dg-do run } */ |
| 2 | |
| 3 | struct Int { |
| 4 | int value; |
| 5 | }; |
| 6 | |
| 7 | __attribute__((noipa)) Int always_throws() { throw 123; } |
| 8 | |
| 9 | void foo(Int &x) { |
| 10 | try { |
| 11 | x = always_throws(); |
| 12 | } catch (...) { |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | int main() |
| 17 | { |
| 18 | Int x; |
| 19 | x.value = 5; |
| 20 | foo(x); |
| 21 | if (x.value != 5) |
| 22 | __builtin_abort (); |
| 23 | } |