Skip to content

got rid of unnecessary ExprIdToken constructors #7728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

firewave
Copy link
Collaborator

@firewave firewave commented Aug 8, 2025

No description provided.

// TODO: Make this constructor only available from ProgramMemory
// cppcheck-suppress noExplicitConstructor
// NOLINTNEXTLINE(google-explicit-constructor)
ExprIdToken(nonneg int exprid) : exprid(exprid) {}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was only used for lookups/comparisons.

@firewave
Copy link
Collaborator Author

firewave commented Aug 8, 2025

A cleanup ahead of #7295.

Copy link

sonarqubecloud bot commented Aug 8, 2025

@@ -154,18 +155,28 @@ void ProgramMemory::setUnknown(const Token* expr) {
(*mValues)[expr].valueType = ValueFlow::Value::ValueType::UNINIT;
}

bool ProgramMemory::hasValue(nonneg int exprid)
bool ProgramMemory::hasValue(nonneg int exprid) const
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Detecting this is tracked in https://trac.cppcheck.net/ticket/12162.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually. With my changes this might have been caught now.

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.

1 participant