Fixes for clang-format - #53
Open
aleclearmind wants to merge 1 commit into
Open
Conversation
parseEnum() only handled a single function-like macro immediately after
'enum' (via the existing parseParens call in the name-scanning loop). A
macro preceding another macro, e.g.
enum _PACKED _ENUM_UNDERLYING(int64_t) name { ... };
made the parser bail at the '(' of the second macro (or hit the "two
identifiers in a row" elaborated-return-type heuristic), so the enum was
not recognized: the space before '{' was dropped and the body collapsed.
enum _PACKED _ENUM_UNDERLYING(int64_t) name{ ... };
This commit skips any run of attribute or typename macros (as configured
via `AttributeMacros`/`TypenameMacros`, including function-like ones)
between `enum` and the enum name before scanning for the name. Using the
configured macro token types avoids misclassifying an elaborate return
type (`enum Color foo() {`) or an enum-typed variable (`enum Color c
{0}`) as an enum definition.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.