clang-tools 22.0.0git
|
Detects return statements that return a constant reference parameter as constant reference. More...
#include <ReturnConstRefFromParameterCheck.h>
Public Member Functions | |
ReturnConstRefFromParameterCheck (StringRef Name, ClangTidyContext *Context) | |
void | registerMatchers (ast_matchers::MatchFinder *Finder) override |
void | check (const ast_matchers::MatchFinder::MatchResult &Result) override |
std::optional< TraversalKind > | getCheckTraversalKind () const override |
bool | isLanguageVersionSupported (const LangOptions &LangOpts) const override |
Detects return statements that return a constant reference parameter as constant reference.
This may cause use-after-free errors if the caller uses xvalues as arguments.
For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/return-const-ref-from-parameter.html
Definition at line 22 of file ReturnConstRefFromParameterCheck.h.
|
inline |
Definition at line 24 of file ReturnConstRefFromParameterCheck.h.
|
override |
Definition at line 101 of file ReturnConstRefFromParameterCheck.cpp.
References clang::tidy::bugprone::findRVRefOverload().
|
inlineoverride |
Definition at line 28 of file ReturnConstRefFromParameterCheck.h.
|
inlineoverride |
Definition at line 33 of file ReturnConstRefFromParameterCheck.h.
|
override |
Definition at line 27 of file ReturnConstRefFromParameterCheck.cpp.