[cfe-commits] r63270 - /cfe/trunk/lib/Sema/SemaInit.cpp

Chris Lattner sabre at nondot.org
Wed Jan 28 21:10:58 PST 2009


Author: lattner
Date: Wed Jan 28 23:10:57 2009
New Revision: 63270

URL: http://llvm.org/viewvc/llvm-project?rev=63270&view=rev
Log:
fix an absolutely inscrutible gcc 4.0 error:

llvm[0]: Compiling SemaInit.cpp for Debug build 
SemaInit.cpp:171: error: ‘InitListChecker’ has not been declared
SemaInit.cpp:171: error: ISO C++ forbids declaration of ‘InitListChecker’ with no type
SemaInit.cpp: In function ‘int InitListChecker(clang::Sema*, clang::InitListExpr*, clang::QualType&)’:
SemaInit.cpp:172: error: ‘hadError’ was not declared in this scope
SemaInit.cpp:173: error: ‘SemaRef’ was not declared in this scope
SemaInit.cpp:177: error: ‘FullyStructuredList’ was not declared in this scope


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

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Wed Jan 28 23:10:57 2009
@@ -49,6 +49,7 @@
 /// point. CheckDesignatedInitializer() recursively steps into the
 /// designated subobject and manages backing out the recursion to
 /// initialize the subobjects after the one designated.
+namespace clang {
 class InitListChecker {
   Sema *SemaRef;
   bool hadError;
@@ -115,6 +116,8 @@
   // semantic analysis and code generation.
   InitListExpr *getFullyStructuredList() const { return FullyStructuredList; }
 };
+}
+
 
 /// Recursively replaces NULL values within the given initializer list
 /// with expressions that perform value-initialization of the
@@ -161,11 +164,12 @@
       ILE->setInit(Init, new (Context) CXXZeroInitValueExpr(ElementType, 
                                                             SourceLocation(),
                                                             SourceLocation()));
-    else if (InitListExpr *InnerILE = dyn_cast<InitListExpr>(ILE->getInit(Init)))
+    else if (InitListExpr *InnerILE =dyn_cast<InitListExpr>(ILE->getInit(Init)))
       fillInValueInitializations(Context, InnerILE);
   }
 }
 
+
 InitListChecker::InitListChecker(Sema *S, InitListExpr *IL, QualType &T) {
   hadError = false;
   SemaRef = S;





More information about the cfe-commits mailing list