Skip to content

Fix #13746: Add [[fallthrough]] attribute to Token and dump#7443

Merged
olabetskyi merged 7 commits intocppcheck-opensource:mainfrom
olabetskyi:add_fallthrough
Apr 11, 2025
Merged

Fix #13746: Add [[fallthrough]] attribute to Token and dump#7443
olabetskyi merged 7 commits intocppcheck-opensource:mainfrom
olabetskyi:add_fallthrough

Conversation

@olabetskyi
Copy link
Copy Markdown
Collaborator

No description provided.

@olabetskyi olabetskyi changed the title Fix #13757: Add [[fallthrough]] attribute to Token and dump Fix #13746: Add [[fallthrough]] attribute to Token and dump Apr 8, 2025
Comment thread test/testsymboldatabase.cpp Outdated
Comment thread lib/tokenize.cpp Outdated
Token * head = tok;
while (head && !Token::Match(head, "case|default"))
head = head->previous();
if (head && Token::Match(head, "case|default |%num% :"))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can switch on characters, booleans, casts...

Comment thread lib/tokenize.cpp Outdated
Token * head = skipCPPOrAlignAttribute(tok)->next();
while (isCPPAttribute(head) || isAlignAttribute(head))
head = skipCPPOrAlignAttribute(head)->next();
head = head->next();
Copy link
Copy Markdown
Collaborator Author

@olabetskyi olabetskyi Apr 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a work in progress. We are deleting attributes or just recreating token here so I was forced to put it on the next one.

Copy link
Copy Markdown
Collaborator

@danmar danmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit

Comment thread lib/tokenize.cpp Outdated
@olabetskyi olabetskyi merged commit fada646 into cppcheck-opensource:main Apr 11, 2025
53 checks passed
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.

3 participants