https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120900
--- Comment #9 from H.J. Lu <hjl.tools at gmail dot com> --- C++ does /* If this is a typedef that names the class for linkage purposes (7.1.3p8), apply any attributes directly to the type. */ if (TREE_CODE (decl) == TYPE_DECL && OVERLOAD_TYPE_P (TREE_TYPE (decl)) && decl == TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (decl)))) flags = ATTR_FLAG_TYPE_IN_PLACE; else flags = 0; /* Set attributes here so if duplicate decl, will have proper attributes. */ cplus_decl_attributes (&decl, attributes, flags); while C does /* Set attributes here so if duplicate decl, will have proper attributes. */ c_decl_attributes (&decl, attributes, 0);