From d699da427a4c49bc01c9ee3d031c7885383568f9 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 14 May 2018 20:15:04 +0000 Subject: 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 --- clang/test/SemaCXX/for-range-examples.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'clang/test/SemaCXX/for-range-examples.cpp') 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 +} -- cgit v1.2.3