mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Casting a slice address to its pointer type should not compile #1193.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
- Casting to a bitstruct would be allowed even if the type was the wrong size.
|
||||
- Generic modules parameterized with constants would sometimes get the wrong parameterized module name causing conversion errors #1192.
|
||||
- Duplicate emit of expressions on negation would incorrectly compile negated macros.
|
||||
- Casting a slice address to its pointer type should not compile #1193.
|
||||
|
||||
### Stdlib changes
|
||||
- Add 'zstr' variants for `string::new_format` / `string::tformat`.
|
||||
|
||||
@@ -676,9 +676,9 @@ typedef enum
|
||||
TYPE_FAULTTYPE,
|
||||
TYPE_TYPEDEF,
|
||||
TYPE_DISTINCT,
|
||||
TYPE_SUBARRAY,
|
||||
TYPE_ARRAY,
|
||||
TYPE_FIRST_ARRAYLIKE = TYPE_ARRAY,
|
||||
TYPE_SUBARRAY,
|
||||
TYPE_FLEXIBLE_ARRAY,
|
||||
TYPE_INFERRED_ARRAY,
|
||||
TYPE_VECTOR,
|
||||
|
||||
7
test/test_suite/cast/cast_slice_implicit.c3
Normal file
7
test/test_suite/cast/cast_slice_implicit.c3
Normal file
@@ -0,0 +1,7 @@
|
||||
fn void foo()
|
||||
{
|
||||
int[] array;
|
||||
int* ptr = array;
|
||||
void* ptr2 = &array;
|
||||
int* ptr3 = &array; // #error: is not permitted
|
||||
}
|
||||
Reference in New Issue
Block a user