]> granicus.if.org Git - clang/commit
Better diagnostics for range-based for loops with bad range types.
authorSam Panzer <espanz@gmail.com>
Tue, 21 Aug 2012 00:52:01 +0000 (00:52 +0000)
committerSam Panzer <espanz@gmail.com>
Tue, 21 Aug 2012 00:52:01 +0000 (00:52 +0000)
commite1715b66a878bcab315513351e5df68bfc010d2e
treebd09db1864a394c68f16dfa348c04f7399d0b562
parenta34d4f47321324187ed57948628f5938357ae034
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
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/Sema.h
lib/Parse/ParseStmt.cpp
lib/Sema/SemaOverload.cpp
lib/Sema/SemaStmt.cpp
lib/Sema/TreeTransform.h
test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp
test/SemaCXX/for-range-dereference.cpp [new file with mode: 0644]
test/SemaCXX/for-range-no-std.cpp
test/SemaCXX/typo-correction.cpp