Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -41,14 +41,9 @@ struct ExprIdToken { | ||
| const Token* tok = nullptr; | ||
| nonneg int exprid = 0; | ||
| ExprIdToken() = default; | ||
| // cppcheck-suppress noExplicitConstructor | ||
| // NOLINTNEXTLINE(google-explicit-constructor) | ||
| ExprIdToken(const Token* tok); | ||
| // TODO: Make this constructor only available from ProgramMemory | ||
| // cppcheck-suppress noExplicitConstructor | ||
| // NOLINTNEXTLINE(google-explicit-constructor) | ||
| ExprIdToken(nonneg int exprid) : exprid(exprid) {} | ||
CollaboratorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was only used for lookups/comparisons. | ||
| nonneg int getExpressionId() const; | ||
| @@ -117,7 +112,7 @@ struct CPPCHECKLIB ProgramMemory { | ||
| void setUnknown(const Token* expr); | ||
| bool getTokValue(nonneg int exprid, const Token*& result) const; | ||
| bool hasValue(nonneg int exprid); | ||
| bool hasValue(nonneg int exprid) const; | ||
| const ValueFlow::Value& at(nonneg int exprid) const; | ||
| ValueFlow::Value& at(nonneg int exprid); | ||
| @@ -150,6 +145,8 @@ struct CPPCHECKLIB ProgramMemory { | ||
| private: | ||
| void copyOnWrite(); | ||
| Map::const_iterator find(nonneg int exprid) const; | ||
| Map::iterator find(nonneg int exprid); | ||
| std::shared_ptr<Map> mValues; | ||
| }; | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.