Have LoopConvert use 'auto &&' where necessary
authorEdwin Vane <edwin.vane@intel.com>
Thu, 7 Mar 2013 16:22:05 +0000 (16:22 +0000)
committerEdwin Vane <edwin.vane@intel.com>
Thu, 7 Mar 2013 16:22:05 +0000 (16:22 +0000)
commit4f05d7143f5cf831e39e5ed16d33a19dc6da9dcd
treeac54e7b59594fe75c9df0e38e5ca4c98303343a5
parent2a760d02f718751c76db2ed3058f3624ac6ed0d4
Have LoopConvert use 'auto &&' where necessary

For iterators where the dereference operator returns by value, LoopConvert
should use 'auto &&' in the range-based for loop expression.

If the dereference operator returns an rvalue reference, this is deemed too
strange and the for loop is not converted.

Moved test case from iterator_failing.cpp to iterator.cpp and added extra
tests.

Fixes PR15437.

Reviewer: gribozavr
llvm-svn: 176631
clang-tools-extra/cpp11-migrate/LoopConvert/LoopActions.cpp
clang-tools-extra/cpp11-migrate/LoopConvert/LoopActions.h
clang-tools-extra/cpp11-migrate/LoopConvert/LoopMatchers.cpp
clang-tools-extra/cpp11-migrate/LoopConvert/LoopMatchers.h
clang-tools-extra/test/cpp11-migrate/LoopConvert/Inputs/structures.h
clang-tools-extra/test/cpp11-migrate/LoopConvert/iterator.cpp
clang-tools-extra/test/cpp11-migrate/LoopConvert/iterator_failing.cpp [deleted file]