Don't check initializers when there are dependent types or type-dependent expressions involved

llvm-svn: 61212
This commit is contained in:
Douglas Gregor 2008-12-18 21:49:58 +00:00
parent 998fd29ce1
commit b04675d112
1 changed files with 3 additions and 0 deletions

View File

@ -787,6 +787,9 @@ StringLiteral *Sema::IsStringLiteralInit(Expr *Init, QualType DeclType) {
bool Sema::CheckInitializerTypes(Expr *&Init, QualType &DeclType,
SourceLocation InitLoc,
DeclarationName InitEntity) {
if (DeclType->isDependentType() || Init->isTypeDependent())
return false;
// C++ [dcl.init.ref]p1:
// A variable declared to be a T&, that is "reference to type T"
// (8.3.2), shall be initialized by an object, or function, of