diff options
Diffstat (limited to 'lib/Sema/SemaLambda.cpp')
-rw-r--r-- | lib/Sema/SemaLambda.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Sema/SemaLambda.cpp b/lib/Sema/SemaLambda.cpp index 6ef8d88bbe..2e391f4d45 100644 --- a/lib/Sema/SemaLambda.cpp +++ b/lib/Sema/SemaLambda.cpp @@ -441,7 +441,10 @@ void Sema::ActOnLambdaError(SourceLocation StartLoc, Scope *CurScope, LambdaScopeInfo *LSI = getCurLambda(); CXXRecordDecl *Class = LSI->Lambda; Class->setInvalidDecl(); - SmallVector<Decl*, 4> Fields(Class->field_begin(), Class->field_end()); + SmallVector<Decl*, 4> Fields; + for (RecordDecl::field_iterator i = Class->field_begin(), + e = Class->field_end(); i != e; ++i) + Fields.push_back(&*i); ActOnFields(0, Class->getLocation(), Class, Fields, SourceLocation(), SourceLocation(), 0); CheckCompletedCXXClass(Class); @@ -704,7 +707,10 @@ ExprResult Sema::ActOnLambdaExpr(SourceLocation StartLoc, Stmt *Body, addBlockPointerConversion(*this, IntroducerRange, Class, CallOperator); // Finalize the lambda class. - SmallVector<Decl*, 4> Fields(Class->field_begin(), Class->field_end()); + SmallVector<Decl*, 4> Fields; + for (RecordDecl::field_iterator i = Class->field_begin(), + e = Class->field_end(); i != e; ++i) + Fields.push_back(&*i); ActOnFields(0, Class->getLocation(), Class, Fields, SourceLocation(), SourceLocation(), 0); CheckCompletedCXXClass(Class); |