Skip to content

Conversation

ludviggunne
Copy link
Collaborator

No description provided.

Copy link

sonarqubecloud bot commented Aug 6, 2025

@@ -4229,7 +4229,7 @@ static bool setVarIdParseDeclaration(Token*& tok, const VariableMap& variableMap
}
if (tok2->isCpp() && Token::Match(tok2, "namespace|public|private|protected"))
return false;
if (tok2->isCpp() && Token::simpleMatch(tok2, "decltype (")) {
if (tok2->isCpp() && Token::Match(tok2, "decltype|typeof|__typeof (")) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's also a GCC extension (https://gcc.gnu.org/onlinedocs/gcc/Typeof.html). But I'm not sure if we should check the standard here at all, it would silentlty fail if it's not configured correctly, and I don't know if there's any point in ever not setting the varid.

Copy link
Collaborator

@chrchr-github chrchr-github Aug 8, 2025

Choose a reason for hiding this comment

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

My point was that the code is currently only executed for C++. Maybe we should handle typeof etc. in C as well.

@ludviggunne ludviggunne marked this pull request as draft August 7, 2025 09:40
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