AddInitializerToDecl needs to take a full expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72640 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h
index 328de90..2ef87be 100644
--- a/include/clang/Parse/Action.h
+++ b/include/clang/Parse/Action.h
@@ -271,7 +271,7 @@
   /// This allows ActOnDeclarator to register "xx" prior to parsing the
   /// initializer. The declaration above should still result in a warning, 
   /// since the reference to "xx" is uninitialized.
-  virtual void AddInitializerToDecl(DeclPtrTy Dcl, ExprArg Init) {
+  virtual void AddInitializerToDecl(DeclPtrTy Dcl, FullExprArg Init) {
     return;
   }
 
diff --git a/lib/Frontend/PrintParserCallbacks.cpp b/lib/Frontend/PrintParserCallbacks.cpp
index ca13f3d..fbac3c8 100644
--- a/lib/Frontend/PrintParserCallbacks.cpp
+++ b/lib/Frontend/PrintParserCallbacks.cpp
@@ -109,7 +109,7 @@
     /// This allows ActOnDeclarator to register "xx" prior to parsing the
     /// initializer. The declaration above should still result in a warning, 
     /// since the reference to "xx" is uninitialized.
-    virtual void AddInitializerToDecl(DeclPtrTy Dcl, ExprArg Init) {
+    virtual void AddInitializerToDecl(DeclPtrTy Dcl, FullExprArg Init) {
       Out << __FUNCTION__ << "\n";
     }
 
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 36ebec3..4fc713c 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -360,7 +360,7 @@
         SkipUntil(tok::semi, true, true);
         return DeclPtrTy();
       }
-      Actions.AddInitializerToDecl(ThisDecl, move(Init));
+      Actions.AddInitializerToDecl(ThisDecl, Actions.FullExpr(Init));
     }
   } else if (Tok.is(tok::l_paren)) {
     // Parse C++ direct initializer: '(' expression-list ')'
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index ecb1775..9939781 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -409,7 +409,7 @@
   virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param, 
                                                  SourceLocation EqualLoc);
   virtual void ActOnParamDefaultArgumentError(DeclPtrTy param);
-  virtual void AddInitializerToDecl(DeclPtrTy dcl, ExprArg init);
+  virtual void AddInitializerToDecl(DeclPtrTy dcl, FullExprArg init);
   void AddInitializerToDecl(DeclPtrTy dcl, ExprArg init, bool DirectInit);
   void ActOnUninitializedDecl(DeclPtrTy dcl);
   virtual void SetDeclDeleted(DeclPtrTy dcl, SourceLocation DelLoc);
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 3ea0b41..09ec071 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2468,8 +2468,8 @@
   return true;
 }
 
-void Sema::AddInitializerToDecl(DeclPtrTy dcl, ExprArg init) {
-  AddInitializerToDecl(dcl, move(init), /*DirectInit=*/false);
+void Sema::AddInitializerToDecl(DeclPtrTy dcl, FullExprArg init) {
+  AddInitializerToDecl(dcl, init.release(), /*DirectInit=*/false);
 }
 
 /// AddInitializerToDecl - Adds the initializer Init to the
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 641fcb7..18382ba 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -744,7 +744,7 @@
   DeclPtrTy Dcl = ActOnDeclarator(S, D, DeclPtrTy());
   if (!Dcl)
     return ExprError();
-  AddInitializerToDecl(Dcl, move(AssignExprVal));
+  AddInitializerToDecl(Dcl, move(AssignExprVal), /*DirectInit=*/false);
 
   // Mark this variable as one that is declared within a conditional.
   // We know that the decl had to be a VarDecl because that is the only type of