]> granicus.if.org Git - clang/commitdiff
Remove VarDecl from CheckInitializerTypes now that CXXConstructExpr doesn't need...
authorAnders Carlsson <andersca@mac.com>
Sat, 30 May 2009 20:41:30 +0000 (20:41 +0000)
committerAnders Carlsson <andersca@mac.com>
Sat, 30 May 2009 20:41:30 +0000 (20:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72630 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/Sema.h
lib/Sema/SemaDecl.cpp
lib/Sema/SemaInit.cpp

index f630e1d6fbc54452c5855f876135ea55e5684d7d..f7d66daf203423deff77dd4d080e5bdf5073bbb4 100644 (file)
@@ -2641,11 +2641,9 @@ public:
   
   /// type checking declaration initializers (C99 6.7.8)
   
-  /// FIXME: The VarDecl parameter should not have a default value,
-  /// and all call sites should be audited.
   bool CheckInitializerTypes(Expr *&simpleInit_or_initList, QualType &declType,
                              SourceLocation InitLoc,DeclarationName InitEntity,
-                             bool DirectInit, VarDecl *VD = 0);
+                             bool DirectInit);
   bool CheckInitList(InitListExpr *&InitList, QualType &DeclType);
   bool CheckForConstantInitializer(Expr *e, QualType t);
   
index 550a1441ac951e9cc5ea79fc2ae832e0ccac183a..3ea0b416229892e9219918e62fb5afe3f8a9a605 100644 (file)
@@ -2551,7 +2551,7 @@ void Sema::AddInitializerToDecl(DeclPtrTy dcl, ExprArg init, bool DirectInit) {
       VDecl->setInvalidDecl();
     } else if (!VDecl->isInvalidDecl()) {
       if (CheckInitializerTypes(Init, DclT, VDecl->getLocation(),
-                                VDecl->getDeclName(), DirectInit, VDecl))
+                                VDecl->getDeclName(), DirectInit))
         VDecl->setInvalidDecl();
       
       // C++ 3.6.2p2, allow dynamic initialization of static initializers.
index 6f71e1b3f72e9a875d2ba778eb9671c2f52d6921..20c712fa2938dac61d1ea676e07ce5b34fb4f0bf 100644 (file)
@@ -119,8 +119,7 @@ static void CheckStringInit(Expr *Str, QualType &DeclT, Sema &S) {
 
 bool Sema::CheckInitializerTypes(Expr *&Init, QualType &DeclType,
                                  SourceLocation InitLoc,
-                                 DeclarationName InitEntity,
-                                 bool DirectInit, VarDecl *VD) {
+                                 DeclarationName InitEntity, bool DirectInit) {
   if (DeclType->isDependentType() || 
       Init->isTypeDependent() || Init->isValueDependent())
     return false;
@@ -175,10 +174,8 @@ bool Sema::CheckInitializerTypes(Expr *&Init, QualType &DeclType,
         if (!Constructor)
           return true;
         
-        // FIXME: What do do if VD is null here?
-        if (VD)
-          Init = CXXConstructExpr::Create(Context, VD, DeclType, Constructor, 
-                                          false, &Init, 1);
+        Init = CXXConstructExpr::Create(Context, 0, DeclType, Constructor, 
+                                        false, &Init, 1);
         return false;
       }