warn-global-constructors.cpp [plain text]
int opaque_int();
namespace test0 {
int a;
int b = 20;
float c = 5.0f;
int d = b;
int e = opaque_int(); int f = b; }
namespace test1 {
struct A { int x; };
A a;
A b = A();
A c = { 10 };
A d = { opaque_int() }; A e = A(A());
A f = A(a); A g(a); A h((A())); A i((A(A()))); }
namespace test2 {
struct A { A(); };
A a; A b[10]; A c[10][10];
A &d = a;
A &e = b[5];
A &f = c[5][7];
}
namespace test3 {
struct A { ~A(); };
A a; A b[10]; A c[10][10];
A &d = a;
A &e = b[5];
A &f = c[5][7];
}
namespace test4 {
char a[] = "hello";
char b[6] = "hello";
char c[][6] = { "hello" };
}
namespace test5 {
struct A { A(); };
void f1() {
static A a;
}
void f2() {
static A& a = *new A;
}
}
namespace test6 {
struct A { ~A(); };
void f1() {
static A a;
}
void f2() {
static A& a = *new A;
}
}
namespace pr8095 {
struct Foo {
int x;
Foo(int x1) : x(x1) {}
};
void foo() {
static Foo a(0);
}
struct Bar {
~Bar();
};
void bar() {
static Bar b;
}
}