Skip to content

Conversation

ludviggunne
Copy link
Collaborator

No description provided.

@ludviggunne ludviggunne force-pushed the 14130 branch 2 times, most recently from bfad711 to 4ad7c65 Compare September 14, 2025 12:23
@firewave
Copy link
Collaborator

We should add more tests which cover the added functionality.

@ludviggunne
Copy link
Collaborator Author

We should add more tests which cover the added functionality.

Most of the additions came about from failing tests in other components, but I could add some others that are more specific.

@ludviggunne ludviggunne force-pushed the 14130 branch 2 times, most recently from b77f655 to 8f029d3 Compare September 16, 2025 16:17
@firewave
Copy link
Collaborator

Most of the additions came about from failing tests in other components, but I could add some others that are more specific.

Good to know. Just looking at the changes this was not evident. So it should be fine then.

@ludviggunne
Copy link
Collaborator Author

ludviggunne commented Sep 24, 2025

Oops, I included a commit that shouldn't be here, I'll remove it later tonight.

Edit: Done.

Copy link

else if (Token::Match(tok->previous(), "%name%") && Token::Match(tok->link(), "] [;={]")) {
tok->previous()->isAttributeMaybeUnused(true);
} else {
if (Token::simpleMatch(head->next(), "[")) {
Copy link
Owner

Choose a reason for hiding this comment

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

I would prefer if we make it explicit what code this is supposed to handle.. how about:

Suggested change
if (Token::simpleMatch(head->next(), "[")) {
if (Token::Match(head, "auto|*|&|&& [")) { // c++17 structured binding

Copy link
Collaborator

Choose a reason for hiding this comment

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

If that is a common pattern we should probably make it a helper.

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