d: Merge upstream dmd, druntime 26f049fb26, phobos 330d6a4fd.
[official-gcc.git] / gcc / testsuite / gdc.test / compilable / test21243.d
blob20838dc973b76fb796ff80acbfdde57eb77afc7d
1 // Parsing - expressions
2 auto a = auto ref (int x) => x;
3 auto b = auto ref (int x) { return x; };
4 auto c = function auto ref (int x) { return x; };
5 auto d = delegate auto ref (int x) { return x; };
7 // Parsing - aliases
8 alias e = auto ref (int x) => x;
9 alias f = auto ref (int x) { return x; };
10 alias g = function auto ref (int x) { return x; };
11 alias h = delegate auto ref (int x) { return x; };
13 // Semantic
14 void test()
16 alias fun(alias x) = auto ref () => x;
17 int n = 123;
18 auto _ = fun!123();
19 static assert(!__traits(compiles, &fun!123())); // rvalue
20 fun!n() = 456; // lvalue