https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122835
--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
It does for C++, which is what I was talking about.
struct S { S (); ~S (); };
struct T { int a, b, c; };
void
foo ()
{
goto l1;
S s;
l1:;
}
void
bar ()
{
goto l2;
T t;
l2:;
}
test.C: In function ‘void foo()’:
test.C:9:1: error: jump to label ‘l1’
9 | l1:;
| ^~
test.C:7:8: note: from here
7 | goto l1;
| ^~
test.C:8:5: note: crosses initialization of ‘S s’
8 | S s;
| ^
