aboutsummaryrefslogtreecommitdiff
path: root/libphobos/libdruntime
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2023-08-15 16:29:08 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2023-08-20 11:20:00 +0200
commitd77c280454cfba48ef38357145cecdabc8c1b05c (patch)
tree49e02afce6ab03a3405752c963b6ffb225012a40 /libphobos/libdruntime
parentce33bbfcbc7dd3afc6c96fb48a19ed00f0c598ce (diff)
downloadgcc-d77c280454cfba48ef38357145cecdabc8c1b05c.zip
gcc-d77c280454cfba48ef38357145cecdabc8c1b05c.tar.gz
gcc-d77c280454cfba48ef38357145cecdabc8c1b05c.tar.bz2
d: Merge upstream dmd, druntime 26f049fb26, phobos 330d6a4fd.
D front-end changes: - Import dmd v2.105.0-beta.1. - Added predefined version identifier VisionOS (ignored by GDC). - Functions can no longer have `enum` storage class. - The deprecation of the `body` keyword has been reverted, it is now an obsolete feature. - The error for `scope class` has been reverted, it is now an obsolete feature. D runtime changes: - Import druntime v2.105.0-beta.1. Phobos changes: - Import phobos v2.105.0-beta.1. - AliasSeq has been removed from std.math. - extern(C) getdelim and getline have been removed from std.stdio. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 26f049fb26. * dmd/VERSION: Bump version to v2.105.0-beta.1. * d-codegen.cc (get_frameinfo): Check useGC in condition. * d-lang.cc (d_handle_option): Set obsolete parameter when compiling with -Wall. (d_post_options): Set useGC to false when compiling with -fno-druntime. Propagate obsolete flag to compileEnv. * expr.cc (ExprVisitor::visit (CatExp *)): Check useGC in condition. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime 26f049fb26. * src/MERGE: Merge upstream phobos 330d6a4fd.
Diffstat (limited to 'libphobos/libdruntime')
-rw-r--r--libphobos/libdruntime/MERGE2
-rw-r--r--libphobos/libdruntime/core/int128.d8
-rw-r--r--libphobos/libdruntime/core/internal/array/comparison.d25
-rw-r--r--libphobos/libdruntime/core/lifetime.d6
4 files changed, 36 insertions, 5 deletions
diff --git a/libphobos/libdruntime/MERGE b/libphobos/libdruntime/MERGE
index 308d51b..a02a8cb 100644
--- a/libphobos/libdruntime/MERGE
+++ b/libphobos/libdruntime/MERGE
@@ -1,4 +1,4 @@
-a88e1335f7ea767ef438c34998f5d1f26008c586
+26f049fb26e755096dea3f1474decea7c0fef187
The first line of this file holds the git revision number of the last
merge done from the dlang/dmd repository.
diff --git a/libphobos/libdruntime/core/int128.d b/libphobos/libdruntime/core/int128.d
index 20fa7de..4c88f15 100644
--- a/libphobos/libdruntime/core/int128.d
+++ b/libphobos/libdruntime/core/int128.d
@@ -14,8 +14,8 @@ nothrow:
@safe:
@nogc:
-alias I = long;
-alias U = ulong;
+private alias I = long;
+private alias U = ulong;
enum Ubits = uint(U.sizeof * 8);
version (DigitalMars)
@@ -36,6 +36,10 @@ else
else private enum Cent_alignment = (size_t.sizeof * 2);
}
+/**
+ * 128 bit integer type.
+ * See_also: $(REF Int128, std,int128).
+ */
align(Cent_alignment) struct Cent
{
version (LittleEndian)
diff --git a/libphobos/libdruntime/core/internal/array/comparison.d b/libphobos/libdruntime/core/internal/array/comparison.d
index 821f96e..94fa243 100644
--- a/libphobos/libdruntime/core/internal/array/comparison.d
+++ b/libphobos/libdruntime/core/internal/array/comparison.d
@@ -83,7 +83,7 @@ int __cmp(T)(scope const T[] lhs, scope const T[] rhs) @trusted
// This function is called by the compiler when dealing with array
// comparisons in the semantic analysis phase of CmpExp. The ordering
// comparison is lowered to a call to this template.
-int __cmp(T1, T2)(T1[] s1, T2[] s2)
+auto __cmp(T1, T2)(T1[] s1, T2[] s2)
if (!__traits(isScalar, T1) && !__traits(isScalar, T2))
{
import core.internal.traits : Unqual;
@@ -237,3 +237,26 @@ if (!__traits(isScalar, T1) && !__traits(isScalar, T2))
auto vb = [cast(void[])b[0], b[1]];
assert(less2(va, vb));
}
+
+// custom aggregate types
+@safe unittest
+{
+ // https://issues.dlang.org/show_bug.cgi?id=24044
+ // Support float opCmp(...) with array
+ static struct F
+ {
+ float f;
+ float opCmp(F other) const { return this.f - other.f; }
+ }
+
+ F[2] a = [F(1.0f), F(float.nan)];
+ F[2] b = [F(1.0f), F(1.0f)];
+ F[1] c = [F(1.0f)];
+
+ bool isNan(float f) { return f != f; }
+
+ assert(isNan(__cmp(a, b)));
+ assert(isNan(__cmp(a, a)));
+ assert(__cmp(b, b) == 0);
+ assert(__cmp(a, c) > 0);
+}
diff --git a/libphobos/libdruntime/core/lifetime.d b/libphobos/libdruntime/core/lifetime.d
index 89236db..3a55ca9 100644
--- a/libphobos/libdruntime/core/lifetime.d
+++ b/libphobos/libdruntime/core/lifetime.d
@@ -1570,7 +1570,11 @@ template forward(args...)
alias fwd = arg;
// (r)value
else
- @property auto fwd(){ pragma(inline, true); return move(arg); }
+ @property auto fwd()
+ {
+ version (DigitalMars) { /* @@BUG 23890@@ */ } else pragma(inline, true);
+ return move(arg);
+ }
}
alias Result = AliasSeq!();