diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-29 05:10:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-29 05:10:57 +0000 |
commit | 68355a57bb9d5daccd3fc73e92370ba2b1a6eafb (patch) | |
tree | 3fa863d600b21ae2af7390436a4462ff85335320 /lib/Sema/SemaInit.cpp | |
parent | 3f2798757c9ee353e207e18115e2e966432a4bee (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63270 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r-- | lib/Sema/SemaInit.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index f810a86250..bb523e179b 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -49,6 +49,7 @@ using namespace clang; /// 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 @@ public: // 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 @@ static void fillInValueInitializations(ASTContext &Context, InitListExpr *ILE) { 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; |