aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/compilable/test10993.d
blob: e5a1b847976f52a4e4a270200de22520633f1ec2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
module test10993;

auto foo(T)(T a)
{
	static immutable typeof(a) q;
//	pragma(msg, "foo: " ~ typeof(q).mangleof);
	return q;
}

struct test(alias fn)
{
	bool ini = true;
	void* p;
}

auto fun()
{
	auto x = foo!()(test!(a=>a)());
//	pragma(msg, "fun: " ~ typeof(x).mangleof);
	
	return x;
}

void main()
{
	const x = fun();
	enum mangle_x = typeof(x).mangleof;
//	pragma(msg, "x  : " ~ mangle_x);
	auto y = cast()x;
	enum mangle_y = typeof(y).mangleof;
//	pragma(msg, "y  : " ~ mangle_y);
	static assert (mangle_y == mangle_x[1..$]);
}