|
clang-tools 24.0.0git
|
Finds casts from a scoped enumeration to its underlying integer type and replaces them with a call to std::to_underlying (C++23). More...
#include <UseToUnderlyingCheck.h>
Public Types | |
| enum class | ImpreciseCastsKind { Ignore , Warn , PreserveType , UseUnderlyingType } |
| How to treat an imprecise cast, i.e. More... | |
Public Member Functions | |
| UseToUnderlyingCheck (StringRef Name, ClangTidyContext *Context) | |
| bool | isLanguageVersionSupported (const LangOptions &LangOpts) const override |
| void | registerPPCallbacks (const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) override |
| void | storeOptions (ClangTidyOptions::OptionMap &Opts) override |
| void | registerMatchers (ast_matchers::MatchFinder *Finder) override |
| void | check (const ast_matchers::MatchFinder::MatchResult &Result) override |
| std::optional< TraversalKind > | getCheckTraversalKind () const override |
Finds casts from a scoped enumeration to its underlying integer type and replaces them with a call to std::to_underlying (C++23).
For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-to-underlying.html
Definition at line 23 of file UseToUnderlyingCheck.h.
|
strong |
How to treat an imprecise cast, i.e.
a cast whose destination type is an integer type other than the enumeration's underlying type.
Definition at line 27 of file UseToUnderlyingCheck.h.
| clang::tidy::modernize::UseToUnderlyingCheck::UseToUnderlyingCheck | ( | StringRef | Name, |
| ClangTidyContext * | Context ) |
Definition at line 39 of file UseToUnderlyingCheck.cpp.
References Warn.
|
override |
Definition at line 99 of file UseToUnderlyingCheck.cpp.
References Ignore, UseUnderlyingType, and Warn.
|
inlineoverride |
Definition at line 47 of file UseToUnderlyingCheck.h.
|
override |
Definition at line 59 of file UseToUnderlyingCheck.cpp.
|
override |
Definition at line 82 of file UseToUnderlyingCheck.cpp.
|
override |
Definition at line 69 of file UseToUnderlyingCheck.cpp.
|
override |
Definition at line 75 of file UseToUnderlyingCheck.cpp.