Skip to content
Unverified Commit 3ed940ac authored by Björn Svensson's avatar Björn Svensson Committed by GitHub
Browse files

[clang-tidy] Add check hicpp-ignored-remove-result (#73119)

This check implements the [rule
17.5.1](https://www.perforce.com/resources/qac/high-integrity-cpp-coding-standard/standard-library)
of the HICPP standard which states:

- Do not ignore the result of std::remove, std::remove_if or std::unique

The mutating algorithms std::remove, std::remove_if and both overloads
of std::unique operate by swapping or moving elements of the range they
are operating over. On completion, they return an iterator to the last
valid element. In the majority of cases the correct behavior is to use
this result as the first operand in a call to std::erase.

This check is based on `bugprone-unused-return-value` but with a fixed
set of functions.

Suppressing issues by casting to `void` is enabled by default, but can
be disabled by setting `AllowCastToVoid` option to `false`.
parent 4e80bc7d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment