llvm-project/clang-tools-extra/test/clang-tidy
poelmanc 98146c1f5d
[clang-tidy] fix modernize-use-nullptr false positive with spaceship operator comparisons
`clang-tidy -std=c++20` with `modernize-use-nullptr` mistakenly inserts `nullptr` in place of the comparison operator if the comparison internally expands in the AST to a rewritten spaceship operator. This can be reproduced by running the new `modernize-use-nullptr-cxx20.cpp` test without applying the supplied patch to `UseNullptrCheck.cpp`; the current clang-tidy will mistakenly replace:
```result = (a1 < a2);```
with
```result = (a1 nullptr a2);```

Reviewed By: njames93

Differential Revision: https://reviews.llvm.org/D95714
2021-02-09 14:02:45 +00:00
..
checkers [clang-tidy] fix modernize-use-nullptr false positive with spaceship operator comparisons 2021-02-09 14:02:45 +00:00
infrastructure [clang-tooling] Prevent llvm::fatal_error on invalid CLI option 2021-01-29 10:15:06 +01:00
check_clang_tidy.py clang-tidy: Make tests more hermetic 2020-10-29 20:14:57 -04:00