d: Merge upstream dmd, druntime 26f049fb26, phobos 330d6a4fd.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / scope_class.d
blobb5e1a54d71bbf5b14084589fdd0e8df51bf606c2
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/scope_class.d(12): Error: functions cannot return `scope scope_class.C`
5 ---
6 */
10 scope class C { int i; } // Notice the use of `scope` here
12 C increment(C c)
14 c.i++;
15 return c;
18 void main()
20 scope C c = new C();
21 c.increment();