[cfe-commits] r61212 - /cfe/trunk/lib/Sema/SemaDecl.cpp

Douglas Gregor dgregor at apple.com
Thu Dec 18 13:50:06 PST 2008


Author: dgregor
Date: Thu Dec 18 15:49:58 2008
New Revision: 61212

URL: http://llvm.org/viewvc/llvm-project?rev=61212&view=rev
Log:
Don't check initializers when there are dependent types or type-dependent expressions involved

Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=61212&r1=61211&r2=61212&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Thu Dec 18 15:49:58 2008
@@ -787,6 +787,9 @@
 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





More information about the cfe-commits mailing list