diff options
author | Sam Panzer <espanz@gmail.com> | 2012-08-21 00:52:01 +0000 |
---|---|---|
committer | Sam Panzer <espanz@gmail.com> | 2012-08-21 00:52:01 +0000 |
commit | e1715b66a878bcab315513351e5df68bfc010d2e (patch) | |
tree | bd09db1864a394c68f16dfa348c04f7399d0b562 /lib/Parse/ParseStmt.cpp | |
parent | a34d4f47321324187ed57948628f5938357ae034 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162248 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseStmt.cpp')
-rw-r--r-- | lib/Parse/ParseStmt.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index 0716f6f901..091d4aaaf2 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/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 |