struct A{ enum A {yesterday, today, tomorrow}; }; int main(){}
The code above gives error prog.cpp:2: error: class A has the same name as the class in which it is declared It is at the best confusing. The error message could probably be 'declaration of a memeber of the same name as the class in which it is declared' or something similar -- Summary: Inappropriate error message Product: gcc Version: 4.3.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: anubhav dot saxena at wipro dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45607