If the range in a for range statement doesn't have a viable begin/end function,
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 20 Sep 2012 21:52:32 +0000 (21:52 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 20 Sep 2012 21:52:32 +0000 (21:52 +0000)
commita05b3b5435a130d36798835980c9374636152ecf
treeb02a04caa7d3b4f760aa3ad75ddbfa0495189e6d
parent0c9773c6d5d452d9fc070859776657df44584bd8
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.

llvm-svn: 164323
clang/include/clang/Sema/Sema.h
clang/lib/Parse/ParseStmt.cpp
clang/lib/Sema/SemaStmt.cpp
clang/lib/Sema/TreeTransform.h
clang/test/SemaCXX/for-range-dereference.cpp