aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/TreeTransform.h
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-09-20 21:52:32 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-09-20 21:52:32 +0000
commit8b533d97e0683a0c87096b95927a2e9ce02243d4 (patch)
tree7d5410b9c89d4fde235fe52eb592867cc579262c /lib/Sema/TreeTransform.h
parentcb5336fa5985a02298aeccf473257c0fcd6b89b4 (diff)
If the range in a for range statement doesn't have a viable begin/end function,
but can be dereferenced to form an expression which does have viable begin/end functions, then typo-correct the range, even if something else goes wrong with the statement (such as inaccessible begin/end or the wrong type of loop variable). In order to ensure we recover correctly and produce any followup diagnostics in this case, redo semantic analysis on the for-range statement outside of the diagnostic trap, after issuing the typo-correction. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164323 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/TreeTransform.h')
-rw-r--r--lib/Sema/TreeTransform.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h
index 71d95ef41f..b8748c7c7a 100644
--- a/lib/Sema/TreeTransform.h
+++ b/lib/Sema/TreeTransform.h
@@ -1330,7 +1330,8 @@ public:
Stmt *LoopVar,
SourceLocation RParenLoc) {
return getSema().BuildCXXForRangeStmt(ForLoc, ColonLoc, Range, BeginEnd,
- Cond, Inc, LoopVar, RParenLoc, false);
+ Cond, Inc, LoopVar, RParenLoc,
+ Sema::BFRK_Rebuild);
}
/// \brief Build a new C++0x range-based for statement.