Passing a variable to std::move now counts as a use for -Wuninitialized
llvm-svn: 216438
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 5293188..0079c49 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -8288,6 +8288,21 @@
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;