mirror of
https://github.com/mirror/tinycc.git
synced 2026-08-30 11:57:51 +08:00
Fix array pointer stringification.
`int (*)[4];` should not be stringified as `int *[4];` Add stringification tests.
This commit is contained in:
@@ -118,4 +118,10 @@ enum e5;
|
||||
void f3(enum e4 e);
|
||||
void f3(enum e5 e);
|
||||
|
||||
#elif defined test_ptr_to_str
|
||||
void f() { _Generic((int const *[]){0}, int:0); }
|
||||
#elif defined test_fnptr_to_str
|
||||
void f() { _Generic((int (*(*)(float,char))(double,int)){0}, int:0); }
|
||||
#elif defined test_array_to_str
|
||||
void f() { _Generic((int(*)[3]){0}, int:0); }
|
||||
#endif
|
||||
|
||||
@@ -44,3 +44,12 @@
|
||||
|
||||
[test_enum_compat]
|
||||
60_errors_and_warnings.c:119: error: incompatible types for redefinition of 'f3'
|
||||
|
||||
[test_ptr_to_str]
|
||||
60_errors_and_warnings.c:122: error: type 'const int **' does not match any association
|
||||
|
||||
[test_fnptr_to_str]
|
||||
60_errors_and_warnings.c:124: error: type 'int (*(*)(float, char))(double, int)' does not match any association
|
||||
|
||||
[test_array_to_str]
|
||||
60_errors_and_warnings.c:126: error: type 'int (*)[3]' does not match any association
|
||||
|
||||
Reference in New Issue
Block a user