]> granicus.if.org Git - clang/commitdiff
Simplify. No behavior change.
authorNico Weber <nicolasweber@gmx.de>
Wed, 20 Jun 2018 15:57:38 +0000 (15:57 +0000)
committerNico Weber <nicolasweber@gmx.de>
Wed, 20 Jun 2018 15:57:38 +0000 (15:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335139 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaInit.cpp

index cd6683e44fe072dd35489240781a766a31e691d8..b3f401e63acce039b58f21f6bd709d553bb5d30a 100644 (file)
@@ -6446,13 +6446,7 @@ static void CheckMoveOnConstruction(Sema &S, const Expr *InitExpr,
 
   // Find the std::move call and get the argument.
   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;
 
   const Expr *Arg = CE->getArg(0)->IgnoreImplicit();