gcc/testsuite/g++.dg/ext/vla14.C
raw| 1 | // PR c++/21113 |
| 2 | // { dg-options "" } |
| 3 | |
| 4 | void |
| 5 | f (int n) |
| 6 | { |
| 7 | goto label; // { dg-message "from here" } |
| 8 | int a[n]; // { dg-message "crosses initialization" } |
| 9 | label: // { dg-error "jump to label" } |
| 10 | ; |
| 11 | } |
| 12 | |
| 13 | void |
| 14 | g (int n) |
| 15 | { |
| 16 | switch (1) |
| 17 | { |
| 18 | case 1: |
| 19 | int (*a)[n]; // { dg-message "crosses initialization" } |
| 20 | default: // { dg-error "jump to case label" } |
| 21 | ; |
| 22 | } |
| 23 | } |