GCC 4.8 can't compile following code:
struct A {
struct Impl;
void f();
};
struct A::Impl {
static int stat;
};
void A::f(){
A::Impl::stat=1;
}
int main(int argc, char** argv) {
return 0;
}
and raise error:
cppbug.cpp:(.text+0xa): undefined reference to `A::Impl::stat' collect2: error: ld returned 1 exit status
but similar inline declaraton compiled as well:
struct A {
struct Impl {
static int stat;
};
void f(){
A::Impl::stat=1;
}
};
int main(int argc, char** argv) {
return 0;
}