Sign in
gnu
/
gcc
/
1f16a020acbea0af26209478990b83b1a1ba3a2b
/
.
/
gcc
/
testsuite
/
gdc.test
/
fail_compilation
/
safe_pointer_index.d
blob: 4b107dba8144ace2e731c98950ac62244109b129 [
file
] [
log
] [
blame
]
/*
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
];
}