diff options
author | dim <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
commit | c86b984ea8ecb3e944dc3de48539f4c1f65851ea (patch) | |
tree | 3eb853da77d46cc77c4b017525a422f9ddb1385b /test/SemaCXX/for-range-examples.cpp | |
parent | c696171ff15f0ee60dea4abfd99a135473c95656 (diff) | |
download | FreeBSD-src-c86b984ea8ecb3e944dc3de48539f4c1f65851ea.zip FreeBSD-src-c86b984ea8ecb3e944dc3de48539f4c1f65851ea.tar.gz |
Vendor import of clang RELEASE_360/rc1 tag r226102 (effectively, 3.6.0 RC1):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_360/rc1@226102
Diffstat (limited to 'test/SemaCXX/for-range-examples.cpp')
-rw-r--r-- | test/SemaCXX/for-range-examples.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/test/SemaCXX/for-range-examples.cpp b/test/SemaCXX/for-range-examples.cpp index 2f777fb..d07331c 100644 --- a/test/SemaCXX/for-range-examples.cpp +++ b/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}} } } |