15
class Foo {
public:
static const char *constant_string;
};
auto Foo::constant_string = "foo";
int main(void) {
};
Compiled with: gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 like this:
gcc -std=c++0x ./foo.cc
./foo.cc:6:11: error: conflicting declaration ‘auto Foo::constant_string’
./foo.cc:3:22: error: ‘Foo::constant_string’ has a previous declaration as ‘const char* Foo::constant_string’
./foo.cc:6:11: error: declaration of ‘const char* Foo::constant_string’ outside of class is not definition [-fpermissive]
Is this intended behavior of the auto keyword, or a bug in gcc+