diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-11-27 01:54:27 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-11-27 01:54:27 +0000 |
commit | 83d3f150c86a7fe86ebabc44f34ceca0979725cb (patch) | |
tree | c6af680efd6067842dfbc88e871884b0e1450660 /clang/test/SemaCXX/for-range-examples.cpp | |
parent | 7ea98e142b9c3ce361739816eece77470bf00248 (diff) | |
download | bcm5719-llvm-83d3f150c86a7fe86ebabc44f34ceca0979725cb.tar.gz bcm5719-llvm-83d3f150c86a7fe86ebabc44f34ceca0979725cb.zip |
[c++1z] Remove terse range-based for loops; they've been removed from
consideration for C++17 for now. Update C++ status page to match.
llvm-svn: 222865
Diffstat (limited to 'clang/test/SemaCXX/for-range-examples.cpp')
-rw-r--r-- | clang/test/SemaCXX/for-range-examples.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/clang/test/SemaCXX/for-range-examples.cpp b/clang/test/SemaCXX/for-range-examples.cpp index 2f777fb46df..d07331c51e2 100644 --- a/clang/test/SemaCXX/for-range-examples.cpp +++ b/clang/test/SemaCXX/for-range-examples.cpp @@ -214,17 +214,19 @@ namespace test6 { namespace test7 { void f() { int arr[5], b; - for (a : arr) {} // expected-warning {{extension}} - // FIXME: Give a -Wshadow for this by default? - for (b : arr) {} // expected-warning {{extension}} - for (arr : arr) {} // expected-warning {{extension}} - for (c alignas(8) : arr) { // expected-warning {{extension}} + for (a : arr) {} // expected-error {{requires type for loop variable}} + // FIXME: Give a different error in this case? + for (b : arr) {} // expected-error {{requires type for loop variable}} + for (arr : arr) {} // expected-error {{requires type for loop variable}} + for (c alignas(8) : arr) { // expected-error {{requires type for loop variable}} static_assert(alignof(c) == 8, ""); // expected-warning {{extension}} } - // FIXME: We should reject this, but don't, because we only check the - // attribute before we deduce the 'auto' type. - for (d alignas(1) : arr) {} // expected-warning {{extension}} - for (e [[deprecated]] : arr) { e = 0; } // expected-warning {{deprecated}} expected-note {{here}} expected-warning {{extension}} + // FIXME: The fix-it hint here is not sufficient to fix the error. + // We fail to diagnose that d is underaligned for its type, because + // we check the alignment attribute before we perform the auto + // deduction. + for (d alignas(1) : arr) {} // expected-error {{requires type for loop variable}} + for (e [[deprecated]] : arr) { e = 0; } // expected-warning {{deprecated}} expected-note {{here}} expected-error {{requires type for loop variable}} } } |