mirror of
https://github.com/mirror/tinycc.git
synced 2026-09-03 12:12:46 +08:00
reject invalid arrays in post_type()
This commit is contained in:
@@ -182,4 +182,20 @@ void * _Alignas(16) p1;
|
||||
_Static_assert(ONE == 0, "don't show me this");
|
||||
_Static_assert(ONE == 1, "ONE is not 1");
|
||||
|
||||
#elif defined test_void_array
|
||||
void t[3];
|
||||
|
||||
#elif defined test_incomplete_enum_array
|
||||
enum e t[3];
|
||||
|
||||
#elif defined test_incomplete_struct_array
|
||||
struct s t[3];
|
||||
|
||||
#elif defined test_const_fun_array
|
||||
typedef void f(void);
|
||||
const f t[3];
|
||||
|
||||
#elif defined test_incomplete_array_array
|
||||
int t[][3];
|
||||
|
||||
#endif
|
||||
|
||||
@@ -86,3 +86,18 @@
|
||||
|
||||
[test_static_assert]
|
||||
60_errors_and_warnings.c:183: error: "ONE is not 1"
|
||||
|
||||
[test_void_array]
|
||||
60_errors_and_warnings.c:186: error: declaration of an array of incomplete type elements
|
||||
|
||||
[test_incomplete_enum_array]
|
||||
60_errors_and_warnings.c:189: error: declaration of an array of incomplete type elements
|
||||
|
||||
[test_incomplete_struct_array]
|
||||
60_errors_and_warnings.c:192: error: declaration of an array of incomplete type elements
|
||||
|
||||
[test_const_fun_array]
|
||||
60_errors_and_warnings.c:196: error: declaration of an array of functions
|
||||
|
||||
[test_incomplete_array_array]
|
||||
60_errors_and_warnings.c:199: error: unknown type size
|
||||
|
||||
Reference in New Issue
Block a user