Daily bump.
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / init9.C
blobd38f978975e6a01f0d2ce15a158597e09fdb4ab9
1 // { dg-do assemble  }
2 // { dg-skip-if "requires hosted libstdc++ for vector" { ! hostedlib } }
4 // Based on a testcase submitted by Tudor Hulubei <tudor@cs.unh.edu>
6 // X is not a POD because it has a user-defined destructor.
7 // Therefore, we can't cross its initialization.
9 // vector<int> is not even an aggregate; nevertheless, no error is
10 // reported...
12 struct A {
13   A() {}
16 void a() {
17   goto bar; // { dg-message "" } jump from here
18   A x; // { dg-message "" } jump crosses initialization
19  bar: // { dg-error "" } jump to here
20   ;
23 struct X {
24   ~X() {}
27 void b() {
28   // This was ill-formed until DR 2256.
29   goto bar;
30   X x;
31  bar:
32   ;
35 #include <vector>
37 void c() {
38   goto bar; // { dg-message "" } jump from here
39   std::vector<int> x; // { dg-message "" } jump crosses initialization
40  bar: // { dg-error "" } jump to here
41   ;