[clang-tidy] don't warn when returning the result for bugprone-standalone-empty
authorv1nh1shungry <v1nh1shungry@outlook.com>
Thu, 12 Jan 2023 23:40:05 +0000 (23:40 +0000)
committerChristopher Di Bella <cjdb@google.com>
Fri, 13 Jan 2023 01:14:51 +0000 (01:14 +0000)
commit7910ee7d8c6dcb679200ba171fba5d8d5f237007
tree8d7d0928496333ae74abe510ed49ab5541eebe5e
parentd4cf89ad5a374f9f81446f12da2386c96b80d3dc
[clang-tidy] don't warn when returning the result for bugprone-standalone-empty

Relevant issue: https://github.com/llvm/llvm-project/issues/59517

Currently this check will warn when the result is used in a `return`
statement, e.g.

```
bool foobar() {
  std::vector<int> v;
  return v.empty();
  // will get a warning here, which makes no sense IMO
}
```

Reviewed By: cjdb, denik

Differential Revision: https://reviews.llvm.org/D141107
clang-tools-extra/clang-tidy/bugprone/StandaloneEmptyCheck.cpp
clang-tools-extra/test/clang-tidy/checkers/bugprone/standalone-empty.cpp