clang-tools 22.0.0git
clang::tidy::bugprone::UndelegatedConstructorCheck Class Reference

Finds creation of temporary objects in constructors that look like a function call to another constructor of the same class. More...

#include <UndelegatedConstructorCheck.h>

Inheritance diagram for clang::tidy::bugprone::UndelegatedConstructorCheck:
[legend]

Public Member Functions

 UndelegatedConstructorCheck (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

Finds creation of temporary objects in constructors that look like a function call to another constructor of the same class.

The user most likely meant to use a delegating constructor or base class initializer.

Definition at line 21 of file UndelegatedConstructorCheck.h.

Constructor & Destructor Documentation

◆ UndelegatedConstructorCheck()

clang::tidy::bugprone::UndelegatedConstructorCheck::UndelegatedConstructorCheck ( StringRef Name,
ClangTidyContext * Context )
inline

Definition at line 23 of file UndelegatedConstructorCheck.h.

Member Function Documentation

◆ check()

void clang::tidy::bugprone::UndelegatedConstructorCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

Definition at line 68 of file UndelegatedConstructorCheck.cpp.

◆ isLanguageVersionSupported()

bool clang::tidy::bugprone::UndelegatedConstructorCheck::isLanguageVersionSupported ( const LangOptions & LangOpts) const
inlineoverride

Definition at line 25 of file UndelegatedConstructorCheck.h.

◆ registerMatchers()

void clang::tidy::bugprone::UndelegatedConstructorCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Definition at line 47 of file UndelegatedConstructorCheck.cpp.


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