summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2014-08-26 04:30:55 +0000
committerRichard Trieu <rtrieu@google.com>2014-08-26 04:30:55 +0000
commit11fd079b6e47148b6f81a6390eae0d2d9e0a035c (patch)
treecb49e9fb3241da3af2f363c8fce431bad39670a4 /clang/lib/Sema/SemaDecl.cpp
parent43ccec8e5314dcd7091e47a98ae08ef86c154697 (diff)
downloadbcm5719-llvm-11fd079b6e47148b6f81a6390eae0d2d9e0a035c.tar.gz
bcm5719-llvm-11fd079b6e47148b6f81a6390eae0d2d9e0a035c.zip
Passing a variable to std::move now counts as a use for -Wuninitialized
llvm-svn: 216438
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp15
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;
OpenPOWER on IntegriCloud