]> granicus.if.org Git - clang/commitdiff
AddInitializerToDecl needs to take a full expression.
authorAnders Carlsson <andersca@mac.com>
Sat, 30 May 2009 21:37:25 +0000 (21:37 +0000)
committerAnders Carlsson <andersca@mac.com>
Sat, 30 May 2009 21:37:25 +0000 (21:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72640 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Parse/Action.h
lib/Frontend/PrintParserCallbacks.cpp
lib/Parse/ParseDecl.cpp
lib/Sema/Sema.h
lib/Sema/SemaDecl.cpp
lib/Sema/SemaExprCXX.cpp

index 328de90036bc8bf83739c756e35ddd5eb0a08615..2ef87be13bdcec646693dc43314d43d7918b15d5 100644 (file)
@@ -271,7 +271,7 @@ public:
   /// 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;
   }
 
index ca13f3df29877398e4fc9370bb9043e0ea78c99f..fbac3c88aa34b23f46478730331b98cbc4107eaa 100644 (file)
@@ -109,7 +109,7 @@ namespace {
     /// 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";
     }
 
index 36ebec33b3b66882cd2d3966f2a44cd463a9e14a..4fc713c88531bfefaf49bd56e3ff5b31b8a47ae8 100644 (file)
@@ -360,7 +360,7 @@ Parser::DeclPtrTy Parser::ParseDeclarationAfterDeclarator(Declarator &D) {
         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 ')'
index ecb17755ebe091171700b9689ec2bda75aea6bcf..9939781667794b006661bc34973fb9916c4996aa 100644 (file)
@@ -409,7 +409,7 @@ public:
   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);
index 3ea0b416229892e9219918e62fb5afe3f8a9a605..09ec071bb1b40d326b7d2d84b96b5d0abb2919a7 100644 (file)
@@ -2468,8 +2468,8 @@ bool Sema::CheckForConstantInitializer(Expr *Init, QualType DclT) {
   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
index 641fcb7e1082a8fc97a8d000cdfed6fc228c7c7b..18382bab21c64a43454364ade4cceadc0affeb41 100644 (file)
@@ -744,7 +744,7 @@ Sema::ActOnCXXConditionDeclarationExpr(Scope *S, SourceLocation StartLoc,
   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