From fd8b4a4b29a2b9d662d0c9a92c1eebd83160b10b Mon Sep 17 00:00:00 2001 From: Steve Naroff Date: Thu, 18 Oct 2007 03:27:23 +0000 Subject: Fix the following bug... unsigned char asso_values[] = { 34 }; int legal2() { return asso_values[0]; } The code that creates the new constant array type was operating on the original type. As a result, the constant type being generated was "unsigned char [1][]" (which is wrong). The fix is to operate on the element type - in this case, the correct type is "unsigned char [1]" I added this case to array-init.c, which clearly didn't catch this bogosity... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43112 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Sema/array-init.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/Sema/array-init.c') diff --git a/test/Sema/array-init.c b/test/Sema/array-init.c index 510a7792d1..5b22681d1b 100644 --- a/test/Sema/array-init.c +++ b/test/Sema/array-init.c @@ -103,6 +103,11 @@ void legal() { }; } +unsigned char asso_values[] = { 34 }; +int legal2() { + return asso_values[0]; +} + void illegal() { short q2[4][][2] = { // expected-error{{array has incomplete element type 'short [][2]'}} { 1, 0, 0, 0, 0, 0 }, -- cgit v1.2.3-70-g09d2