Closed
Description
Bugzilla Link | 8075 |
Resolution | FIXED |
Resolved on | Oct 05, 2010 21:44 |
Version | unspecified |
OS | All |
CC | @DougGregor |
Extended Description
% cat t4.cc
struct S1 {
enum { FOO = 42 };
static const int bar = 42;
static int baz();
S1(int);
};
const int S1::bar;
struct S2 {
S1 s1;
S2() : s1(s1.FOO) {}
};
struct S3 {
S1 s1;
S3() : s1(s1.bar) {}
};
struct S4 {
S1 s1;
S4() : s1(s1.baz()) {}
};
% ./bin/clang -fsyntax-only -Wall t4.cc
t4.cc:12:13: warning: field is uninitialized when used here [-Wuninitialized]
S2() : s1(s1.FOO) {}
^
t4.cc:17:13: warning: field is uninitialized when used here [-Wuninitialized]
S3() : s1(s1.bar) {}
^
2 warnings generated.