This code is valid, but GCC rejects it: struct X { int X; }; int X::*p = &X::X;
// error: taking address of constructor 'X::X' GCC apparently seems to think that X::X looks up to the injected class name, and thus (by 3.4.3.1/1a) would name the constructor. But the name of the non-static data member should hide the injected class name. -- Summary: GCC does not correctly hide injected class name Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: schaub-johannes at web dot de GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44401