]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gdc.test/compilable/ice6538.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / compilable / ice6538.d
CommitLineData
b4c522fa
IB
1
2
3/**************************************/
5fee5ec3 4// https://issues.dlang.org/show_bug.cgi?id=6538
b4c522fa
IB
5
6template allSatisfy(alias F, T...) { enum bool allSatisfy = true; }
7template isIntegral(T) { enum bool isIntegral = true; }
8
9void foo(I...)(I sizes)
10if (allSatisfy!(isIntegral, sizes)) {}
11
12void test6538a()
13{
14 foo(42, 86);
15}
16
17void bar(T1, T2)(T1 t1, T2 t2)
18if (allSatisfy!(isIntegral, t1, t2)) {}
19
20void test6538b()
21{
22 bar(42, 86);
23}
24
25/**************************************/
5fee5ec3 26// https://issues.dlang.org/show_bug.cgi?id=9361
b4c522fa
IB
27
28template Sym(alias A)
29{
30 enum Sym = true;
31}
32
33struct S
34{
35 void foo()() if (Sym!(this)) {}
36 void bar()() { static assert(Sym!(this)); } // OK
37}
38void test9361a()
39{
40 S s;
41 s.foo(); // fail
42 s.bar(); // OK
43}