clang-tools 22.0.0git
|
The checker looks for constructors that can act as copy or move constructors through their forwarding reference parameters. More...
#include <ForwardingReferenceOverloadCheck.h>
Public Member Functions | |
ForwardingReferenceOverloadCheck (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 |
The checker looks for constructors that can act as copy or move constructors through their forwarding reference parameters.
If a non const lvalue reference is passed to the constructor, the forwarding reference parameter can be a perfect match while the const reference parameter of the copy constructor can't. The forwarding reference constructor will be called, which can lead to confusion. For detailed description of this problem see: Scott Meyers, Effective Modern C++ Design, item 26.
For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/forwarding-reference-overload.html
Definition at line 27 of file ForwardingReferenceOverloadCheck.h.
|
inline |
Definition at line 29 of file ForwardingReferenceOverloadCheck.h.
|
override |
Definition at line 92 of file ForwardingReferenceOverloadCheck.cpp.
References clang::tidy::bugprone::Move.
|
inlineoverride |
Definition at line 31 of file ForwardingReferenceOverloadCheck.h.
|
override |
Definition at line 61 of file ForwardingReferenceOverloadCheck.cpp.