The code: class A {}; extern A* a;
namespace { A* a; } int main() { a = 0; } gets you: ~/ootbc/members/src$ g++ foo.cc foo.cc: In function `int main()': foo.cc:9: error: `a' undeclared (first use this function) foo.cc:9: error: (Each undeclared identifier is reported only once for each function it appears in.) -- Summary: Loses two declartions for the price of one Product: gcc Version: 3.4.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: igodard at pacbell dot net CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21731