-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[clang][analyzer] Add StoreToImmutable checker #150417
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
0630d81
[clang][analyzer] Add StoreToImmutable checker
gamesh411 fa3f84f
Apply review suggestiongs by @steakhal
gamesh411 b022182
[review-fix] fix test files
gamesh411 5190ee0
[review-fix] add test case for complex memory hierarchy
gamesh411 856a865
[review-fix] remove isInSystemMacro check
gamesh411 d8f3456
[review-fix] add example note on string literal limitation
gamesh411 01d0521
[review-fix] implement hierarchical memregion handling
gamesh411 2aacf92
[cornercase] Lambda initialization gives a false positive in C++14 an…
gamesh411 6e8a332
[format] fixed example file code formatting
gamesh411 d65aa88
[review-fix] don't repeat type names
gamesh411 7e94b10
[cornercase] fix false positive cornercase
gamesh411 4db2804
[review-fix] streamline example file
gamesh411 7e73177
[review-fix] add more C++ standard versions
gamesh411 cac94fe
[review-fix] streamline implementation
gamesh411 373679b
[review-fix] support SubRegions not just ElementRegions
gamesh411 7cbabf8
[review-fix] fix typo
gamesh411 e377b19
[review-fix] delete stray whitespace
gamesh411 cfedf88
[review-fix] more elaborate notes
gamesh411 fa0a379
[review-fix] remove redundant comments from example
gamesh411 4e6c988
[review-fix] document our options for the fixme
gamesh411 17a0e9c
Merge branch 'main' into store-to-immutable-checker
gamesh411 89389a5
[review-fix] clarify wording
gamesh411 4d883f1
fix formatting
gamesh411 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| // RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -std=c++14 -verify %s | ||
NagyDonat marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // expected-no-diagnostics | ||
|
|
||
| // In C++14 and before, when initializing a lambda, the statement given in the checkBind callback is not the whole DeclExpr, but the CXXConstructExpr of the lambda object. | ||
| // FIXME: Once the API of checkBind provides more information about the statement, the checker should be simplified, and this this test case will no longer be a cornercase in the checker. | ||
gamesh411 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| void test_const_lambda_initialization_pre_cpp17() { | ||
| const auto lambda = [](){}; // No warning expected | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.