clang-tools
22.0.0git
llvm-project
clang-tools-extra
clang-tidy
hicpp
IgnoredRemoveResultCheck.h
Go to the documentation of this file.
1
//===----------------------------------------------------------------------===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_IGNOREDREMOVERESULTCHECK_H
10
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_IGNOREDREMOVERESULTCHECK_H
11
12
#include "
../bugprone/UnusedReturnValueCheck.h
"
13
14
namespace
clang::tidy::hicpp
{
15
16
/// Ensure that the result of std::remove, std::remove_if and std::unique
17
/// are not ignored according to rule 17.5.1.
18
///
19
/// For the user-facing documentation see:
20
/// https://clang.llvm.org/extra/clang-tidy/checks/hicpp/ignored-remove-result.html
21
class
IgnoredRemoveResultCheck
:
public
bugprone::UnusedReturnValueCheck
{
22
public
:
23
IgnoredRemoveResultCheck
(StringRef Name,
ClangTidyContext
*Context);
24
bool
isLanguageVersionSupported
(
const
LangOptions &LangOpts)
const override
{
25
return
LangOpts.CPlusPlus;
26
}
27
void
storeOptions
(
ClangTidyOptions::OptionMap
&Opts)
override
;
28
};
29
30
}
// namespace clang::tidy::hicpp
31
32
#endif
// LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_IGNOREDREMOVERESULTCHECK_H
UnusedReturnValueCheck.h
clang::tidy::ClangTidyContext
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Definition
ClangTidyDiagnosticConsumer.h:70
clang::tidy::bugprone::UnusedReturnValueCheck
Detects function calls where the return value is unused.
Definition
UnusedReturnValueCheck.h:21
clang::tidy::hicpp::IgnoredRemoveResultCheck::storeOptions
void storeOptions(ClangTidyOptions::OptionMap &Opts) override
Definition
IgnoredRemoveResultCheck.cpp:26
clang::tidy::hicpp::IgnoredRemoveResultCheck::IgnoredRemoveResultCheck
IgnoredRemoveResultCheck(StringRef Name, ClangTidyContext *Context)
Definition
IgnoredRemoveResultCheck.cpp:13
clang::tidy::hicpp::IgnoredRemoveResultCheck::isLanguageVersionSupported
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override
Definition
IgnoredRemoveResultCheck.h:24
clang::tidy::hicpp
Definition
ExceptionBaseclassCheck.cpp:15
clang::tidy::ClangTidyOptions::OptionMap
llvm::StringMap< ClangTidyValue > OptionMap
Definition
ClangTidyOptions.h:128
Generated on
for clang-tools by
1.14.0