]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/test17977.d
d: Merge upstream dmd 3982604c5, druntime bc58b1e9, phobos 12329adb6.
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / test17977.d
1 /*
2 https://issues.dlang.org/show_bug.cgi?id=15399
3 REQUIRED_ARGS: -preview=dip1000
4 TEST_OUTPUT:
5 ---
6 fail_compilation/test17977.d(19): Error: address of variable `__slList3` assigned to `elem` with longer lifetime
7 ---
8 */
9
10 @safe:
11 struct List {
12 int* data;
13 ~this();
14 int* front() return;
15 }
16
17 void test()
18 {
19 auto elem = List().front;
20 }