P0184R0: Allow types of 'begin' and 'end' expressions in range-based for loops to differ.

llvm-svn: 263895
This commit is contained in:
Richard Smith
2016-03-20 10:33:40 +00:00
parent 25a63b1bcc
commit 01694c340d
15 changed files with 109 additions and 68 deletions

View File

@@ -3397,8 +3397,10 @@ CFGBlock *CFGBuilder::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
// Create local scopes and destructors for range, begin and end variables.
if (Stmt *Range = S->getRangeStmt())
addLocalScopeForStmt(Range);
if (Stmt *BeginEnd = S->getBeginEndStmt())
addLocalScopeForStmt(BeginEnd);
if (Stmt *Begin = S->getBeginStmt())
addLocalScopeForStmt(Begin);
if (Stmt *End = S->getEndStmt())
addLocalScopeForStmt(End);
addAutomaticObjDtors(ScopePos, save_scope_pos.get(), S);
LocalScope::const_iterator ContinueScopePos = ScopePos;
@@ -3489,7 +3491,8 @@ CFGBlock *CFGBuilder::VisitCXXForRangeStmt(CXXForRangeStmt *S) {
// Add the initialization statements.
Block = createBlock();
addStmt(S->getBeginEndStmt());
addStmt(S->getBeginStmt());
addStmt(S->getEndStmt());
return addStmt(S->getRangeStmt());
}