mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
12 lines
208 B
D
12 lines
208 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/safe_pointer_index.d(11): Error: `@safe` function `f` cannot index pointer `x`
|
|
---
|
|
*/
|
|
|
|
@safe void f(int* x)
|
|
{
|
|
int y = x[0]; // allowed, same as *x
|
|
int z = x[1];
|
|
}
|