diff options
| author | Edwin Vane <edwin.vane@intel.com> | 2013-03-07 16:22:05 +0000 |
|---|---|---|
| committer | Edwin Vane <edwin.vane@intel.com> | 2013-03-07 16:22:05 +0000 |
| commit | 4f05d7143f5cf831e39e5ed16d33a19dc6da9dcd (patch) | |
| tree | ac54e7b59594fe75c9df0e38e5ca4c98303343a5 /clang-tools-extra/test/cpp11-migrate/LoopConvert/iterator_failing.cpp | |
| parent | 2a760d02f718751c76db2ed3058f3624ac6ed0d4 (diff) | |
| download | bcm5719-llvm-4f05d7143f5cf831e39e5ed16d33a19dc6da9dcd.tar.gz bcm5719-llvm-4f05d7143f5cf831e39e5ed16d33a19dc6da9dcd.zip | |
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
Diffstat (limited to 'clang-tools-extra/test/cpp11-migrate/LoopConvert/iterator_failing.cpp')
| -rw-r--r-- | clang-tools-extra/test/cpp11-migrate/LoopConvert/iterator_failing.cpp | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/clang-tools-extra/test/cpp11-migrate/LoopConvert/iterator_failing.cpp b/clang-tools-extra/test/cpp11-migrate/LoopConvert/iterator_failing.cpp deleted file mode 100644 index 5684497f745..00000000000 --- a/clang-tools-extra/test/cpp11-migrate/LoopConvert/iterator_failing.cpp +++ /dev/null @@ -1,14 +0,0 @@ -// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp -// RUN: cpp11-migrate -loop-convert %t.cpp -- -I %S/Inputs -// RUN: FileCheck -input-file=%t.cpp %s -// XFAIL: * -#include "structures.h" - -void f() { - // See PR15437 for details. - PtrSet<int*> int_ptrs; - for (PtrSet<int*>::iterator I = int_ptrs.begin(), - E = int_ptrs.end(); I != E; ++I) { - // CHECK: for (const auto & int_ptr : int_ptrs) { - } -} |

