below is an example in standard N2960. struct A { A(); }; struct B : public A { B(); }; A::A() { } B::B() { } A::A a; int main() { return 0; }
According to the standard [class.qual]/2, 'A::A a;' is error because A::A is not a type name. But g++ can compile it without error or warning. -- Summary: g++ violate [class.qual] Product: gcc Version: 4.3.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pi3orama at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42064