Given the program typedef enum { ZERO }; // error, malformed typedef, missing identifier typedef struct dummy {}; // ditto
gcc will silently step over and apparently ignore the typedef, treating the statement as a simple "enum { ZERO };" rather than a "typedef enum { ZERO } type_name;" where type_name has been accidentally omitted. Grammatically, perhaps correct. However, a warning or error message here would be handy. -- Summary: Malformed typedef silently ignored Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: simon_baldwin at yahoo dot com CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23689