Correct handling of enum attributes with g++

From OpenBSD's commit log:

This was responsible for memory corruption with recent versions
of Mesa where c and c++ code share a header with a packed enum type.

Reference:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39219

Obtained from:	OpenBSD (CVS rev. 1.2)
MFC after:	1 week
This commit is contained in:
Pedro F. Giffuni 2015-10-11 19:58:57 +00:00
parent f98f68bd50
commit e277c15f54
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=289150

View File

@ -10906,6 +10906,7 @@ cp_parser_enum_specifier (cp_parser* parser)
if (cp_parser_allow_gnu_extensions_p (parser))
{
tree trailing_attr = cp_parser_attributes_opt (parser);
trailing_attr = chainon (trailing_attr, attributes);
cplus_decl_attributes (&type,
trailing_attr,
(int) ATTR_FLAG_TYPE_IN_PLACE);