repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git]
/
gcc
/
testsuite
/
gdc.test
/
fail_compilation
/
fail20448.d
blob
916ee8bbc077b1139d042f901a0ef70c04dfd44f
1
/*
2
TEST_OUTPUT:
3
---
4
fail_compilation/fail20448.d(16): Error: returning `p.x` escapes a reference to parameter `p`
5
fail_compilation/fail20448.d(22): Error: template instance `fail20448.member!"x"` error instantiating
6
---
7
*/
8
9
struct
S
10
{
11
int
x
,
y
;
12
}
13
14
ref int
member
(
string mem
)(
S p
)
15
{
16
return
p
.
x
;
17
}
18
19
void
main
()
20
{
21
S p
;
22
p
.
member
!
"x"
=
2
;
23
}