Refactoring code around move/copy initialization.  NFC.

Use an enum parameter instead of a bool for more control on how the copy elision
functions work.  Extract the move initialization code from the move or copy
initialization block.

Patch by: Arthur O'Dwyer

Differential Revision: https://reviews.llvm.org/D43898

llvm-svn: 327598
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 8875eb2..df11315 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -742,7 +742,7 @@
 
   if (D->isNRVOVariable()) {
     QualType ReturnType = cast<FunctionDecl>(DC)->getReturnType();
-    if (SemaRef.isCopyElisionCandidate(ReturnType, Var, false))
+    if (SemaRef.isCopyElisionCandidate(ReturnType, Var, Sema::CES_Strict))
       Var->setNRVOVariable(true);
   }