diff --git a/gcc/d/dmd/expressionsem.d b/gcc/d/dmd/expressionsem.d index 515de3447..88ae28707 100644 --- a/gcc/d/dmd/expressionsem.d +++ b/gcc/d/dmd/expressionsem.d @@ -8923,7 +8923,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor TypeAArray ta = cast(TypeAArray)t2b; // Special handling for array keys - if (!arrayTypeCompatible(exp.e1.loc, exp.e1.type, ta.index)) + if (!arrayTypeCompatibleWithoutCasting(exp.e1.type, ta.index)) { // Convert key to type of key exp.e1 = exp.e1.implicitCastTo(sc, ta.index); diff --git a/gcc/d/dmd/traits.d b/gcc/d/dmd/traits.d index 574645d89..1b5c51fb2 100644 --- a/gcc/d/dmd/traits.d +++ b/gcc/d/dmd/traits.d @@ -1010,7 +1010,7 @@ extern (C++) Expression semanticTraits(TraitsExp e, Scope* sc) // If the symbol passed as a parameter is an // interface that inherits other interfaces overloadApply(f, &dg); - if (ifd && ifd.interfaces) + if (ifd && ifd.interfaces && f) { // check the overloads of each inherited interface individually foreach (bc; ifd.interfaces) diff --git a/gcc/d/verstr.h b/gcc/d/verstr.h index 6da741fd8..ddba1dfc7 100644 --- a/gcc/d/verstr.h +++ b/gcc/d/verstr.h @@ -1 +1 @@ -"2.081.1" +"2.081.2" diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail19076.d b/gcc/testsuite/gdc.test/fail_compilation/fail19076.d new file mode 100644 index 000000000..9bfc0a564 --- /dev/null +++ b/gcc/testsuite/gdc.test/fail_compilation/fail19076.d @@ -0,0 +1,11 @@ +/* +TEST_OUTPUT: +--- +fail_compilation/fail19076.d(11): Error: no property `V` for type `fail19076.I` +fail_compilation/fail19076.d(11): Error: `(I).V` cannot be resolved +--- +*/ + +interface P { } +interface I : P { } +auto F = __traits(getVirtualFunctions, I, "V"); diff --git a/gcc/testsuite/gdc.test/fail_compilation/test19112.d b/gcc/testsuite/gdc.test/fail_compilation/test19112.d new file mode 100644 index 000000000..f5bd4035e --- /dev/null +++ b/gcc/testsuite/gdc.test/fail_compilation/test19112.d @@ -0,0 +1,16 @@ +/* TEST_OUTPUT: +--- +fail_compilation/test19112.d(13): Error: cannot implicitly convert expression `[123, 456]` of type `int[]` to `int[1]` +fail_compilation/test19112.d(15): Error: cannot implicitly convert expression `a` of type `int[]` to `int[1]` +--- +*/ + +// https://issues.dlang.org/show_bug.cgi?id=19112 + +void main() +{ + int[int[1]] aa; + int* p = [123, 456] in aa; + int[] a; + p = a in aa; +} diff --git a/libphobos/configure b/libphobos/configure index 05d7e828c..3fa94c362 100755 --- a/libphobos/configure +++ b/libphobos/configure @@ -14557,8 +14557,8 @@ SPEC_PHOBOS_DEPS="$LIBS" # Libdruntime / phobos soname version -DRUNTIME_SOVERSION="76:2:0" -PHOBOS_SOVERSION="76:2:0" +DRUNTIME_SOVERSION="81:2:0" +PHOBOS_SOVERSION="81:2:0" diff --git a/libphobos/configure.ac b/libphobos/configure.ac index 70fccec36..55241d8bf 100644 --- a/libphobos/configure.ac +++ b/libphobos/configure.ac @@ -148,8 +148,8 @@ SPEC_PHOBOS_DEPS="$LIBS" AC_SUBST(SPEC_PHOBOS_DEPS) # Libdruntime / phobos soname version -DRUNTIME_SOVERSION="76:2:0" -PHOBOS_SOVERSION="76:2:0" +DRUNTIME_SOVERSION="81:2:0" +PHOBOS_SOVERSION="81:2:0" AC_SUBST([DRUNTIME_SOVERSION]) AC_SUBST([PHOBOS_SOVERSION]) diff --git a/libphobos/libdruntime/core/memory.d b/libphobos/libdruntime/core/memory.d index a5c42de76..4e3ee5aff 100644 --- a/libphobos/libdruntime/core/memory.d +++ b/libphobos/libdruntime/core/memory.d @@ -1019,7 +1019,7 @@ void __delete(T)(ref T x) @system } else static if (is(T : E2[], E2)) { - GC.free(x.ptr); + GC.free(cast(void*) x.ptr); x = null; } } @@ -1167,3 +1167,21 @@ unittest int* pint; __delete(pint); S* ps; __delete(ps); } + +// https://issues.dlang.org/show_bug.cgi?id=19092 +unittest +{ + const(int)[] x = [1, 2, 3]; + assert(GC.addrOf(x.ptr) != null); + __delete(x); + assert(x is null); + assert(GC.addrOf(x.ptr) == null); + + immutable(int)[] y = [1, 2, 3]; + assert(GC.addrOf(y.ptr) != null); + __delete(y); + assert(y is null); + assert(GC.addrOf(y.ptr) == null); +} + + diff --git a/libphobos/src/std/conv.d b/libphobos/src/std/conv.d index 81eb168f6..ad4b80f73 100644 --- a/libphobos/src/std/conv.d +++ b/libphobos/src/std/conv.d @@ -2737,7 +2737,6 @@ Target parse(Target, Source)(ref Source source) if (isInputRange!Source && isSomeChar!(ElementType!Source) && !is(Source == enum) && isFloatingPoint!Target && !is(Target == enum)) { - import core.stdc.math : HUGE_VAL; import std.ascii : isDigit, isAlpha, toLower, toUpper, isHexDigit; import std.exception : enforce; @@ -3240,7 +3239,7 @@ if (isInputRange!Source && isSomeChar!(ElementType!Source) && !is(Source == enum } } L6: // if overflow occurred - enforce(ldval != HUGE_VAL, new ConvException("Range error")); + enforce(ldval != real.infinity, new ConvException("Range error")); L1: static if (isNarrowString!Source) diff --git a/libphobos/src/std/random.d b/libphobos/src/std/random.d index 7e63fb823..e56579065 100644 --- a/libphobos/src/std/random.d +++ b/libphobos/src/std/random.d @@ -2182,8 +2182,7 @@ do immutable T u = (rng.front - rng.min) * factor; rng.popFront(); - import core.stdc.limits : CHAR_BIT; // CHAR_BIT is always 8 - static if (isIntegral!R && T.mant_dig >= (CHAR_BIT * R.sizeof)) + static if (isIntegral!R && T.mant_dig >= (8 * R.sizeof)) { /* If RNG variates are integral and T has enough precision to hold * R without loss, we're guaranteed by the definition of factor diff --git a/libphobos/src/std/range/package.d b/libphobos/src/std/range/package.d index 4701bab97..a3981ae90 100644 --- a/libphobos/src/std/range/package.d +++ b/libphobos/src/std/range/package.d @@ -8587,13 +8587,11 @@ public: * gap: (7 - 4) % 2 = 3 % 2 = 1 * end: 7 - 1 = 6 */ - pragma(inline, true); return (source.length - windowSize) % stepSize; } private size_t numberOfFullFrames() { - pragma(inline, true); /** 5.iota.slides(2, 1) => [0, 1], [1, 2], [2, 3], [3, 4] (4) 7.iota.slides(2, 2) => [0, 1], [2, 3], [4, 5], [6] (3) @@ -8610,7 +8608,6 @@ public: // Whether the last slide frame size is less than windowSize private bool hasPartialElements() { - pragma(inline, true); static if (withPartial) return gap != 0 && source.length > numberOfFullFrames * stepSize; else @@ -9387,6 +9384,14 @@ public: }} } +// https://issues.dlang.org/show_bug.cgi?id=19082 +@safe unittest +{ + import std.algorithm.comparison : equal; + import std.algorithm.iteration : map; + assert([1].map!(x => x).slide(2).equal!equal([[1]])); +} + private struct OnlyResult(T, size_t arity) { private this(Values...)(auto ref Values values)