From f75f89fc8f2116c4cfe35022c19ed854e6a23b84 Mon Sep 17 00:00:00 2001 From: Edmund Grimley Evans Date: Mon, 11 Jan 2016 07:51:58 +0000 Subject: tccgen.c: In parse_btype, handle type qualifiers applied to arrays. Also add some test cases in tests/tests2/39_typedef.c. --- tests/tests2/39_typedef.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/tests2') diff --git a/tests/tests2/39_typedef.c b/tests/tests2/39_typedef.c index 79ab58b..3878b9c 100644 --- a/tests/tests2/39_typedef.c +++ b/tests/tests2/39_typedef.c @@ -28,4 +28,20 @@ int main() return 0; } +/* "If the specification of an array type includes any type qualifiers, + the element type is so-qualified, not the array type." */ + +typedef int A[3]; +extern A const ca; +extern const A ca; +extern const int ca[3]; + +typedef A B[1][2]; +extern B const cb; +extern const B cb; +extern const int cb[1][2][3]; + +extern B b; +extern int b[1][2][3]; + /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/ -- cgit v1.3.1