Merge remote-tracking branch 'upstream/stable' into merge_stable

This commit is contained in:
Martin Nowak 2015-08-10 10:07:27 +02:00
commit e45f39c55a

View file

@ -394,9 +394,8 @@ template Tuple(Specs...)
}
enum areCompatibleTuples(Tup1, Tup2, string op) = isTuple!Tup2 && is(typeof(
(ref Tup1 tup1, ref Tup2 tup2)
{
Tup1 tup1 = void;
Tup2 tup2 = void;
static assert(tup1.field.length == tup2.field.length);
foreach (i, _; Tup1.Types)
{
@ -1148,6 +1147,24 @@ unittest
static assert( is(typeof(tc4 < tm4)));
static assert( is(typeof(tc4 < tc4)));
}
// Bugzilla 14890
static void test14890(inout int[] dummy)
{
alias V = Tuple!(int, int);
V mv;
const V cv;
immutable V iv;
inout V wv; // OK <- NG
inout const V wcv; // OK <- NG
foreach (v1; TypeTuple!(mv, cv, iv, wv, wcv))
foreach (v2; TypeTuple!(mv, cv, iv, wv, wcv))
{
static assert(__traits(compiles, v1 < v2),
typeof(v1).stringof ~ " < " ~ typeof(v2).stringof);
}
}
{
int[2] ints = [ 1, 2 ];
Tuple!(int, int) t = ints;