summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaLambda.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-03-08 20:12:42 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-03-08 20:12:42 +0000
commit8328f6462b3e0b8d77a2da5cfbdf1885950e5fc8 (patch)
tree4f04e9f1980f32d611aa295339a054b06e255cd4 /lib/Sema/SemaLambda.cpp
parent0ce08a07392951d4c05c8d754317cfd3105760d0 (diff)
[C++11] Replacing RecordDecl iterators field_begin() and field_end() with iterator_range fields(). Updating all of the usages of the iterators with range-based for loops.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203355 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLambda.cpp')
-rw-r--r--lib/Sema/SemaLambda.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/Sema/SemaLambda.cpp b/lib/Sema/SemaLambda.cpp
index 0dbe8ced18..4ef23ad72d 100644
--- a/lib/Sema/SemaLambda.cpp
+++ b/lib/Sema/SemaLambda.cpp
@@ -1147,11 +1147,9 @@ void Sema::ActOnLambdaError(SourceLocation StartLoc, Scope *CurScope,
CXXRecordDecl *Class = LSI->Lambda;
Class->setInvalidDecl();
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);
+ llvm::copy(Class->fields(), std::back_inserter(Fields));
+ ActOnFields(0, Class->getLocation(), Class, Fields, SourceLocation(),
+ SourceLocation(), 0);
CheckCompletedCXXClass(Class);
PopFunctionScopeInfo();
@@ -1510,11 +1508,9 @@ ExprResult Sema::ActOnLambdaExpr(SourceLocation StartLoc, Stmt *Body,
// Finalize the lambda class.
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);
+ llvm::copy(Class->fields(), std::back_inserter(Fields));
+ ActOnFields(0, Class->getLocation(), Class, Fields, SourceLocation(),
+ SourceLocation(), 0);
CheckCompletedCXXClass(Class);
}