diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-05-14 20:15:04 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-05-14 20:15:04 +0000 |
commit | d699da427a4c49bc01c9ee3d031c7885383568f9 (patch) | |
tree | 01cd593aac8dad7f8b5760864ce5737ef39f7638 /clang/test/SemaCXX/for-range-examples.cpp | |
parent | 771f2422d06b1aca660333ff89ef62529e395f27 (diff) | |
download | bcm5719-llvm-d699da427a4c49bc01c9ee3d031c7885383568f9.tar.gz bcm5719-llvm-d699da427a4c49bc01c9ee3d031c7885383568f9.zip |
PR37450: Fix bug that disabled some type checks for variables with deduced types.
Also improve diagnostic for the case where a type is non-literal because it's a lambda.
llvm-svn: 332286
Diffstat (limited to 'clang/test/SemaCXX/for-range-examples.cpp')
-rw-r--r-- | clang/test/SemaCXX/for-range-examples.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/clang/test/SemaCXX/for-range-examples.cpp b/clang/test/SemaCXX/for-range-examples.cpp index d6b527ff8a5..4fb3d3b3d53 100644 --- a/clang/test/SemaCXX/for-range-examples.cpp +++ b/clang/test/SemaCXX/for-range-examples.cpp @@ -221,11 +221,7 @@ namespace test7 { for (c alignas(8) : arr) { // expected-error {{requires type for loop variable}} static_assert(alignof(c) == 8, ""); // 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 (d alignas(1) : arr) {} // expected-error {{requested alignment is less than minimum alignment of 8 for type 'int &'}} 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}} } } @@ -274,4 +270,4 @@ int foo(int b) { }(); return b; } -}
\ No newline at end of file +} |