]> granicus.if.org Git - clang/commitdiff
Don't check initializers when there are dependent types or type-dependent expressions...
authorDouglas Gregor <dgregor@apple.com>
Thu, 18 Dec 2008 21:49:58 +0000 (21:49 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 18 Dec 2008 21:49:58 +0000 (21:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61212 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp

index 511103fa75199ad0943f376384aa9aa7aebe39ce..925a7bb29b56947048cc9e73f83ba589bcb304ee 100644 (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