clang-tools 22.0.0git
clang::tidy::google::objc::AvoidNSObjectNewCheck Class Reference

This check finds Objective-C code that uses +new to create object instances, or overrides +new in classes. More...

#include <AvoidNSObjectNewCheck.h>

Inheritance diagram for clang::tidy::google::objc::AvoidNSObjectNewCheck:
[legend]

Public Member Functions

 AvoidNSObjectNewCheck (StringRef Name, ClangTidyContext *Context)
bool isLanguageVersionSupported (const LangOptions &LangOpts) const override
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override

Detailed Description

This check finds Objective-C code that uses +new to create object instances, or overrides +new in classes.

Both are forbidden by Google's Objective-C style guide.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/google/objc-avoid-nsobject-new.html

Definition at line 22 of file AvoidNSObjectNewCheck.h.

Constructor & Destructor Documentation

◆ AvoidNSObjectNewCheck()

clang::tidy::google::objc::AvoidNSObjectNewCheck::AvoidNSObjectNewCheck ( StringRef Name,
ClangTidyContext * Context )
inline

Definition at line 24 of file AvoidNSObjectNewCheck.h.

Member Function Documentation

◆ check()

void clang::tidy::google::objc::AvoidNSObjectNewCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

◆ isLanguageVersionSupported()

bool clang::tidy::google::objc::AvoidNSObjectNewCheck::isLanguageVersionSupported ( const LangOptions & LangOpts) const
inlineoverride

Definition at line 26 of file AvoidNSObjectNewCheck.h.

◆ registerMatchers()

void clang::tidy::google::objc::AvoidNSObjectNewCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Definition at line 94 of file AvoidNSObjectNewCheck.cpp.


The documentation for this class was generated from the following files: