1// { dg-do assemble  }
2
3// Based on a testcase submitted by Tudor Hulubei <tudor@cs.unh.edu>
4
5// X is not a POD because it has a user-defined destructor.
6// Therefore, we can't cross its initialization.
7
8// vector<int> is not even an aggregate; nevertheless, no error is
9// reported...
10
11struct A {
12  A() {}
13};
14
15void a() {
16  goto bar; // { dg-error "" } jump from here
17  A x; // { dg-error "" } jump crosses initialization
18 bar: // { dg-error "" } jump to here
19  ;
20}
21
22struct X {
23  ~X() {}
24};
25
26void b() {
27  goto bar; // { dg-error "" } jump from here
28  X x; // { dg-error "" } jump crosses initialization
29 bar: // { dg-error "" } jump to here
30  ;
31}
32
33#include <vector>
34
35void c() {
36  goto bar; // { dg-error "" } jump from here
37  std::vector<int> x; // { dg-error "" } jump crosses initialization
38 bar: // { dg-error "" } jump to here
39  ;
40}
41