blob: 916ee8bbc077b1139d042f901a0ef70c04dfd44f [file] [log] [blame]
/*
TEST_OUTPUT:
---
fail_compilation/fail20448.d(16): Error: returning `p.x` escapes a reference to parameter `p`
fail_compilation/fail20448.d(22): Error: template instance `fail20448.member!"x"` error instantiating
---
*/
struct S
{
int x, y;
}
ref int member(string mem)(S p)
{
return p.x;
}
void main()
{
S p;
p.member!"x" = 2;
}