]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/fail11503d.d
Add D front-end, libphobos library, and D2 testsuite.
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail11503d.d
1 struct Data2
2 {
3 char buffer;
4 }
5
6 @property const(char)[] filename(const ref Data2 d) pure nothrow
7 {
8 return (&d.buffer)[0 .. 1];
9 }
10
11 @property const(char)[] filename2(const Data2* d) pure nothrow
12 {
13 return (&d.buffer)[0 .. 1];
14 }
15
16 void main()
17 {
18 Data2 d;
19 string f = d.filename;
20 string g = (&d).filename2;
21 d.buffer = 'a';
22 }