clang-tools 19.0.0git
IgnoredRemoveResultCheck.cpp
Go to the documentation of this file.
1//===--- IgnoredRemoveResultCheck.cpp - clang-tidy ------------------------===//
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
10
11namespace clang::tidy::hicpp {
12
14 ClangTidyContext *Context)
15 : UnusedReturnValueCheck(Name, Context,
16 "::std::remove;"
17 "::std::remove_if;"
18 "::std::unique") {
19 // The constructor for ClangTidyCheck needs to have been called
20 // before we can access options via Options.get().
21 AllowCastToVoid = Options.get("AllowCastToVoid", true);
22}
23
25 Options.store(Opts, "AllowCastToVoid", AllowCastToVoid);
26}
27
28} // namespace clang::tidy::hicpp
llvm::SmallString< 256U > Name
std::optional< StringRef > get(StringRef LocalName) const
Read a named option from the Context.
void store(ClangTidyOptions::OptionMap &Options, StringRef LocalName, StringRef Value) const
Stores an option with the check-local name LocalName with string value Value to Options.
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
void storeOptions(ClangTidyOptions::OptionMap &Opts) override
Should store all options supported by this check with their current values or default values for opti...
IgnoredRemoveResultCheck(StringRef Name, ClangTidyContext *Context)
llvm::StringMap< ClangTidyValue > OptionMap