-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang-tidy] bugprone-assert-side-effect non-const operator methods (#…
…71974) With this PR, `bugprone-assert-side-effect` reports non-const calls to `<<` and `>>` operators and does no longer consider any const operator calls to have side effects. E.g. the following snippet is now reported and was previously not: ``` std::stringstream ss; assert(ss << 1); ``` The following snippet was previously a false-positive and is not reported anymore: ``` struct { int operator+=(int i) const { return i; } } t; assert(t += 1); ```
- Loading branch information
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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 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