summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseStmt.cpp
diff options
context:
space:
mode:
authorSam Panzer <espanz@gmail.com>2012-08-21 00:52:01 +0000
committerSam Panzer <espanz@gmail.com>2012-08-21 00:52:01 +0000
commit0f38443616f503f6c1f86e4f3ec9255a91058306 (patch)
tree44c4f850eb7a5751d87564f73a67dac1bab31eaf /clang/lib/Parse/ParseStmt.cpp
parent74e6f9fc6546c4b0104e1b5e8e037415ea62ff7c (diff)
downloadbcm5719-llvm-0f38443616f503f6c1f86e4f3ec9255a91058306.tar.gz
bcm5719-llvm-0f38443616f503f6c1f86e4f3ec9255a91058306.zip
Better diagnostics for range-based for loops with bad range types.
The old error message stating that 'begin' was an undeclared identifier is replaced with a new message explaining that the error is in the range expression, along with which of the begin() and end() functions was problematic if relevant. Additionally, if the range was a pointer type or defines operator*, attempt to dereference the range, and offer a FixIt if the modified range works. llvm-svn: 162248
Diffstat (limited to 'clang/lib/Parse/ParseStmt.cpp')
-rw-r--r--clang/lib/Parse/ParseStmt.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp
index 0716f6f901c..091d4aaaf20 100644
--- a/clang/lib/Parse/ParseStmt.cpp
+++ b/clang/lib/Parse/ParseStmt.cpp
@@ -1441,7 +1441,7 @@ StmtResult Parser::ParseForStatement(SourceLocation *TrailingElseLoc) {
ForRangeStmt = Actions.ActOnCXXForRangeStmt(ForLoc, FirstPart.take(),
ForRangeInit.ColonLoc,
ForRangeInit.RangeExpr.get(),
- T.getCloseLocation());
+ T.getCloseLocation(), true);
// Similarly, we need to do the semantic analysis for a for-range
OpenPOWER on IntegriCloud