Skip to content

fix: preserve GCC __attribute__ between enum keyword and name in AST#1457

Open
strimo378 wants to merge 3 commits into
eclipse-cdt:mainfrom
emmtrix:copilot/fix-attribute-dropped-in-ast
Open

fix: preserve GCC __attribute__ between enum keyword and name in AST#1457
strimo378 wants to merge 3 commits into
eclipse-cdt:mainfrom
emmtrix:copilot/fix-attribute-dropped-in-ast

Conversation

@strimo378
Copy link
Copy Markdown

__attribute__ placed between enum and the tag name (e.g. enum __attribute__((packed)) color { ... }) was silently dropped from the AST. The parser consumed the tokens correctly but discarded the returned attribute list instead of attaching it to the IASTEnumerationSpecifier.

// Previously: attribute was consumed but not added to the AST node
enum __attribute__ ((packed)) color {
    RED = 1,
    GREEN = 2
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants