| 1 |
// { dg-do compile { target c++20 } } |
| 2 |
// { dg-options "-w" } |
| 3 |
|
| 4 |
void f() |
| 5 |
{ |
| 6 |
goto l; // { dg-message "from here" } |
| 7 |
if consteval // { dg-message "enters 'consteval if'" } |
| 8 |
{ |
| 9 |
l:; // { dg-error "jump to label" } |
| 10 |
} |
| 11 |
} |
| 12 |
|
| 13 |
void g() |
| 14 |
{ |
| 15 |
goto l; // { dg-message "from here" } |
| 16 |
if not consteval // { dg-message "enters 'consteval if'" } |
| 17 |
{ |
| 18 |
l:; // { dg-error "jump to label" } |
| 19 |
} |
| 20 |
} |
| 21 |
|
| 22 |
void h() |
| 23 |
{ |
| 24 |
goto l; // { dg-message "from here" } |
| 25 |
if consteval // { dg-message "enters 'consteval if'" } |
| 26 |
{ |
| 27 |
} |
| 28 |
else |
| 29 |
{ |
| 30 |
l:; // { dg-error "jump to label" } |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
void i() |
| 35 |
{ |
| 36 |
goto l; // { dg-message "from here" } |
| 37 |
if not consteval // { dg-message "enters 'consteval if'" } |
| 38 |
{ |
| 39 |
} |
| 40 |
else |
| 41 |
{ |
| 42 |
l:; // { dg-error "jump to label" } |
| 43 |
} |
| 44 |
} |