]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/compilable/scopeinfer.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / compilable / scopeinfer.d
1 // PERMUTE_ARGS: -preview=dip1000
2
3 // Mangling should be the same with or without inference of `return scope`
4
5 @safe:
6
7 auto foo(void* p) { return 0; }
8 static assert(typeof(foo).mangleof == "FNaNbNiNfPvZi");
9
10 auto bar(void* p) { return p; }
11 static assert(typeof(bar).mangleof == "FNaNbNiNfPvZQd");
12
13 // https://issues.dlang.org/show_bug.cgi?id=19857
14
15 struct Stack()
16 {
17 @safe:
18 int** data;
19 ref int* top()
20 {
21 return *data;
22 }
23 }
24
25 alias S = Stack!();
26
27 //pragma(msg, S.top.mangleof);
28
29 version (Win32)
30 static assert(S.top.mangleof == "_D10scopeinfer__T5StackZQh3topMFNaNbNcNiNfZPi");