d: Merge upstream dmd, druntime 26f049fb26, phobos 330d6a4fd.
[official-gcc.git] / gcc / testsuite / gdc.test / compilable / test22133.d
blobaff762c71806676dc3615d8e611faff677ad6aff
1 // https://issues.dlang.org/show_bug.cgi?id=22133
3 struct Slice
5 bool empty() const;
6 int front() const;
7 void popFront()() // note: requires a mutable Slice
8 {}
11 enum isInputRange1(R) = is(typeof((R r) => r.popFront));
12 enum isInputRange2(R) = __traits(compiles, (R r) => r.popFront);
13 static assert(isInputRange1!( Slice) == true);
14 static assert(isInputRange1!(const Slice) == false);
15 static assert(isInputRange2!( Slice) == true);
16 static assert(isInputRange2!(const Slice) == false);