Skip to content

Commit

Permalink
[clang-tidy] hicpp-ignored-remove-result ignore functions with same p…
Browse files Browse the repository at this point in the history
…refixes as the target (#87587)
  • Loading branch information
HerrCai0907 committed Apr 5, 2024
1 parent 66190af commit ff1e72d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ IgnoredRemoveResultCheck::IgnoredRemoveResultCheck(llvm::StringRef Name,
ClangTidyContext *Context)
: UnusedReturnValueCheck(Name, Context,
{
"::std::remove",
"::std::remove_if",
"::std::unique",
"::std::remove$",
"::std::remove_if$",
"::std::unique$",
}) {
// The constructor for ClangTidyCheck needs to have been called
// before we can access options via Options.get().
Expand Down
4 changes: 4 additions & 0 deletions clang-tools-extra/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ Changes in existing checks
- Improved :doc:`google-runtime-int <clang-tidy/checks/google/runtime-int>`
check performance through optimizations.

- Improved :doc:`hicpp-ignored-remove-result <clang-tidy/checks/hicpp/ignored-remove-result>`
check by ignoring other functions with same prefixes as the target specific
functions.

- Improved :doc:`llvm-header-guard
<clang-tidy/checks/llvm/header-guard>` check by replacing the local
option `HeaderFileExtensions` by the global option of the same name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ ForwardIt unique(ForwardIt, ForwardIt);
template <class InputIt, class T>
InputIt find(InputIt, InputIt, const T&);

struct unique_disposable {
void* release();
};

class error_code {
};

Expand Down Expand Up @@ -63,4 +67,6 @@ void noWarning() {
// bugprone-unused-return-value's checked return types.
errorFunc();
(void) errorFunc();

std::unique_disposable{}.release();
}

0 comments on commit ff1e72d

Please sign in to comment.