reject invalid arrays in post_type()

This commit is contained in:
Pascal Cuoq
2019-06-24 10:28:36 +02:00
parent 942b73bbbb
commit cbbba01b46
3 changed files with 39 additions and 3 deletions

View File

@@ -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

View File

@@ -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