|
clang-tools 23.0.0git
|
#include <UseNullptrCheck.h>
Public Member Functions | |
| UseNullptrCheck (StringRef Name, ClangTidyContext *Context) | |
| bool | isLanguageVersionSupported (const LangOptions &LangOpts) const override |
| void | storeOptions (ClangTidyOptions::OptionMap &Opts) override |
| void | registerMatchers (ast_matchers::MatchFinder *Finder) override |
| Create a matcher that finds implicit casts as well as the head of a sequence of zero or more nested explicit casts that have an implicit cast to null within. | |
| void | check (const ast_matchers::MatchFinder::MatchResult &Result) override |
Definition at line 16 of file UseNullptrCheck.h.
| clang::tidy::modernize::UseNullptrCheck::UseNullptrCheck | ( | StringRef | Name, |
| ClangTidyContext * | Context ) |
Definition at line 495 of file UseNullptrCheck.cpp.
|
override |
Definition at line 509 of file UseNullptrCheck.cpp.
References clang::tidy::modernize::CastSequence.
|
inlineoverride |
Definition at line 19 of file UseNullptrCheck.h.
|
override |
Create a matcher that finds implicit casts as well as the head of a sequence of zero or more nested explicit casts that have an implicit cast to null within.
Finding sequences of explicit casts is necessary so that an entire sequence can be replaced instead of just the inner-most implicit cast.
TODO/NOTE: The second "anyOf" below discards matches on a substituted type, since we don't know if that would always be a pointer type for all other specializations, unless the expression was "__null", in which case we assume that all specializations are expected to be for pointer types. Ideally this would check for the "NULL" macro instead, but that'd be harder to express. In practice, "NULL" is often defined as "__null", and this is a useful condition.
Definition at line 48 of file UseNullptrCheck.cpp.
References clang::tidy::modernize::CastSequence, and clang::tidy::matchers::matchesAnyListedTypeName().
|
override |
Definition at line 503 of file UseNullptrCheck.cpp.
References clang::tidy::utils::options::serializeStringList().