forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang-tidy] Add
std::span
to default `bugprone-dangling-handle.Han…
…dleClasses` (llvm#107711) `std::span` suffers from the same dangling issues as `std::string_view`. This patch adds `std::span` to the default list of handle classes in `bugprone-dangling-handle`, allowing clang-tidy to catch e.g. the following: ```cpp span<int> f() { // All these return values will dangle. array<int, 1> A; return {A}; vector<int> Array; return {Array}; } ```
- Loading branch information
Showing
3 changed files
with
15 additions
and
4 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