diff options
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 5293188214c..0079c4925ac 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -8288,6 +8288,21 @@ namespace { Inherited::VisitCXXConstructExpr(E); } + void VisitCallExpr(CallExpr *E) { + // Treat std::move as a use. + if (E->getNumArgs() == 1) { + if (FunctionDecl *FD = E->getDirectCallee()) { + if (FD->getIdentifier() && FD->getIdentifier()->isStr("move")) { + if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E->getArg(0))) { + HandleDeclRefExpr(DRE); + } + } + } + } + + Inherited::VisitCallExpr(E); + } + void HandleDeclRefExpr(DeclRefExpr *DRE) { Decl* ReferenceDecl = DRE->getDecl(); if (OrigDecl != ReferenceDecl) return; |