Skip to content

Fix #14251 FP constParameterReference for struct with optional struct member#7948

Merged
chrchr-github merged 5 commits intodanmar:mainfrom
chrchr-github:chr_14251
Nov 7, 2025
Merged

Fix #14251 FP constParameterReference for struct with optional struct member#7948
chrchr-github merged 5 commits intodanmar:mainfrom
chrchr-github:chr_14251

Conversation

@chrchr-github
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread lib/astutils.cpp Fixed
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Nov 6, 2025

@chrchr-github chrchr-github merged commit 7100bda into danmar:main Nov 7, 2025
55 checks passed
@chrchr-github chrchr-github deleted the chr_14251 branch November 7, 2025 18:03
Comment thread lib/astutils.cpp
return false;
const Token* varTok = tok->astOperand2();
return !varTok || !varTok->variable() || !varTok->variable()->valueType() || varTok->variable()->valueType()->pointer == 0;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This will return true for smart pointers. This should probably be named isOwnerWithDeref or something like that. We should also add optional to the library config, but we could check for class names optional.

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.

4 participants