clang-tools 22.0.0git
clang::tidy::performance::NoexceptMoveConstructorCheck Class Reference

The check flags user-defined move constructors and assignment operators not marked with noexcept or marked with noexcept(expr) where expr evaluates to false (but is not a false literal itself). More...

#include <NoexceptMoveConstructorCheck.h>

Inheritance diagram for clang::tidy::performance::NoexceptMoveConstructorCheck:
[legend]

Public Member Functions

void registerMatchers (ast_matchers::MatchFinder *Finder) override
 NoexceptFunctionBaseCheck (StringRef Name, ClangTidyContext *Context)
Public Member Functions inherited from clang::tidy::performance::NoexceptFunctionBaseCheck
 NoexceptFunctionBaseCheck (StringRef Name, ClangTidyContext *Context)
bool isLanguageVersionSupported (const LangOptions &LangOpts) const override
void check (const ast_matchers::MatchFinder::MatchResult &Result) final override
std::optional< TraversalKind > getCheckTraversalKind () const override

Additional Inherited Members

Static Protected Attributes inherited from clang::tidy::performance::NoexceptFunctionBaseCheck
static constexpr StringRef BindFuncDeclName = "FuncDecl"

Detailed Description

The check flags user-defined move constructors and assignment operators not marked with noexcept or marked with noexcept(expr) where expr evaluates to false (but is not a false literal itself).

Move constructors of all the types used with STL containers, for example, need to be declared noexcept. Otherwise STL will choose copy constructors instead. The same is valid for move assignment operations.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/performance/noexcept-move-constructor.html

Definition at line 27 of file NoexceptMoveConstructorCheck.h.

Member Function Documentation

◆ NoexceptFunctionBaseCheck()

clang::tidy::performance::NoexceptFunctionBaseCheck::NoexceptFunctionBaseCheck ( StringRef Name,
ClangTidyContext * Context )
inline

Definition at line 24 of file NoexceptFunctionBaseCheck.h.

◆ registerMatchers()

void clang::tidy::performance::NoexceptMoveConstructorCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

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