aboutsummaryrefslogtreecommitdiff
path: root/libphobos/src/std/algorithm
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/src/std/algorithm
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/src/std/algorithm')
-rw-r--r--libphobos/src/std/algorithm/searching.d17
1 files changed, 17 insertions, 0 deletions
diff --git a/libphobos/src/std/algorithm/searching.d b/libphobos/src/std/algorithm/searching.d
index f061915..37a08de 100644
--- a/libphobos/src/std/algorithm/searching.d
+++ b/libphobos/src/std/algorithm/searching.d
@@ -1528,6 +1528,23 @@ if (isInputRange!Range && !isInfinite!Range &&
assert([S(5), S(6)].extremum!"a.value" == S(5));
}
+// https://issues.dlang.org/show_bug.cgi?id=24027
+@safe nothrow unittest
+{
+ class A
+ {
+ int a;
+ this(int a)
+ {
+ this.a = a;
+ }
+ }
+
+ auto test = new A(5);
+ A[] arr = [test];
+ assert(maxElement!"a.a"(arr) is test);
+}
+
// find
/**
Finds an individual element in an $(REF_ALTTEXT input range, isInputRange, std,range,primitives).