Remove VarDecl from CheckInitializerTypes now that CXXConstructExpr doesn't need to take a VarDecl anymore. (It still does, but it won't for long)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72630 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index f630e1d..f7d66da 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -2641,11 +2641,9 @@
/// 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);
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 550a144..3ea0b41 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2551,7 +2551,7 @@
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.
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index 6f71e1b..20c712f 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -119,8 +119,7 @@
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 @@
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;
}