tccgen.c: In parse_btype, handle type qualifiers applied to arrays.

Also add some test cases in tests/tests2/39_typedef.c.
This commit is contained in:
Edmund Grimley Evans
2016-01-11 07:51:58 +00:00
parent 541b33591c
commit f75f89fc8f
2 changed files with 41 additions and 14 deletions

View File

@ -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 :*/