We want anonymous structs with typedefs to have consistent names across translation units, so that functions with such parameters mangle properly for linking.  (g++ mangles typedefed anonymous structs the same as named structs.) Since this code is technically illegal anyway we can do the simple thing and name the compound type by the typedef.  (This is imprecise because "typedef struct { } foo" now also creates a "struct foo", but who in their right mind would do "typedef struct { } foo" and then declare a different "struct foo"?)
We want anonymous structs with typedefs to have consistent names across
translation units, so that functions with such parameters mangle properly for
linking.  (g++ mangles typedefed anonymous structs the same as named structs.)
Since this code is technically illegal anyway we can do the simple thing and
name the compound type by the typedef.  (This is imprecise because "typedef
struct { } foo" now also creates a "struct foo", but who in their right mind
would do "typedef struct { } foo" and then declare a different "struct foo"?)

same for enums.


angavrilov/olmar,angavrilov/olmar,angavrilov/olmar,angavrilov/olmar