]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gdc.test/compilable/test20789.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / compilable / test20789.d
CommitLineData
5fee5ec3
IB
1// REQUIRED_ARGS: -de
2module compilable.test20789;
3
4struct S(bool deprecateFunction, bool deprecateAlias)
5{
6 static if (deprecateFunction)
7 deprecated string get() { return "foo"; }
8 else
9 string get() { return "foo"; }
10
11 static if (deprecateAlias)
12 deprecated alias get this;
13 else
14 alias get this;
15}
16
17void main()
18{
19 void normalFun()
20 {
21 static assert( is(S!(false, false) : string));
22 static assert(!is(S!(false, true ) : string));
23 static assert(!is(S!(true , false) : string));
24 static assert(!is(S!(true , true ) : string));
25 }
26 deprecated void deprecatedFun()
27 {
28 // deprecations are allowed in a deprecated scope.
29 static assert(is(S!(false, false) : string));
30 static assert(is(S!(false, true ) : string));
31 static assert(is(S!(true , false) : string));
32 static assert(is(S!(true , true ) : string));
33 }
34}