Browse Source

Simplify. No behavior change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335139 91177308-0d34-0410-b5e6-96231b3b80d8
Nico Weber 7 years ago
parent
commit
2e7bf27afa
1 changed files with 1 additions and 7 deletions
  1. 1 7
      lib/Sema/SemaInit.cpp

+ 1 - 7
lib/Sema/SemaInit.cpp

@@ -6446,13 +6446,7 @@ static void CheckMoveOnConstruction(Sema &S, const Expr *InitExpr,
 
 
   // Find the std::move call and get the argument.
   // Find the std::move call and get the argument.
   const CallExpr *CE = dyn_cast<CallExpr>(InitExpr->IgnoreParens());
   const CallExpr *CE = dyn_cast<CallExpr>(InitExpr->IgnoreParens());
-  if (!CE || CE->getNumArgs() != 1)
-    return;
-
-  const FunctionDecl *MoveFunction = CE->getDirectCallee();
-  if (!MoveFunction || !MoveFunction->isInStdNamespace() ||
-      !MoveFunction->getIdentifier() ||
-      !MoveFunction->getIdentifier()->isStr("move"))
+  if (!CE || !CE->isCallToStdMove())
     return;
     return;
 
 
   const Expr *Arg = CE->getArg(0)->IgnoreImplicit();
   const Expr *Arg = CE->getArg(0)->IgnoreImplicit();