aboutsummaryrefslogtreecommitdiff
path: root/libphobos/src/std/algorithm/mutation.d
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2022-01-02 13:36:51 +0100
committerIain Buclaw <ibuclaw@gdcproject.org>2022-01-03 12:26:05 +0100
commitc43b5909031c7aa32ac65df3e392a12d32c45194 (patch)
treeb7ef2e344e36132f68816e197e39c58bd39e9ac9 /libphobos/src/std/algorithm/mutation.d
parentbd5b0fca54341545ecf83f6775fc471f6f174142 (diff)
downloadgcc-c43b5909031c7aa32ac65df3e392a12d32c45194.zip
gcc-c43b5909031c7aa32ac65df3e392a12d32c45194.tar.gz
gcc-c43b5909031c7aa32ac65df3e392a12d32c45194.tar.bz2
d: Merge upstream dmd 001bfd97b, druntime 759e6023, phobos 468788323.
D front-end changes: - Import latest changes to mainline. - Fix bad format specifiers in front-end errors (PR103840). - Refactoring of some leaf modules to the dmd/root package. - Updating copyright notice dates and urls. Phobos changes: - Import latest changes to mainline. gcc/d/ChangeLog: PR d/103840 * dmd/MERGE: Merge upstream dmd 001bfd97b. * Make-lang.in (D_FRONTEND_OBJS): Rename d/complex.o to d/root-complex.o, and d/utf.o to d/root/utf.o. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime 759e6023. * src/MERGE: Merge upstream phobos 468788323.
Diffstat (limited to 'libphobos/src/std/algorithm/mutation.d')
-rw-r--r--libphobos/src/std/algorithm/mutation.d20
1 files changed, 18 insertions, 2 deletions
diff --git a/libphobos/src/std/algorithm/mutation.d b/libphobos/src/std/algorithm/mutation.d
index 22b7b98..b0e7707 100644
--- a/libphobos/src/std/algorithm/mutation.d
+++ b/libphobos/src/std/algorithm/mutation.d
@@ -866,6 +866,9 @@ if (isInputRange!InputRange
Initializes all elements of `range` with their `.init` value.
Assumes that the elements of the range are uninitialized.
+This function is unavailable if `T` is a `struct` and `T.this()` is annotated
+with `@disable`.
+
Params:
range = An
$(REF_ALTTEXT input range, isInputRange, std,range,primitives)
@@ -874,10 +877,11 @@ Params:
See_Also:
$(LREF fill)
- $(LREF uninitializeFill)
+ $(LREF uninitializedFill)
*/
void initializeAll(Range)(Range range)
-if (isInputRange!Range && hasLvalueElements!Range && hasAssignableElements!Range)
+if (isInputRange!Range && hasLvalueElements!Range && hasAssignableElements!Range
+ && __traits(compiles, { static ElementType!Range _; }))
{
import core.stdc.string : memset, memcpy;
import std.traits : hasElaborateAssign, isDynamicArray;
@@ -1037,6 +1041,18 @@ if (is(Range == char[]) || is(Range == wchar[]))
assert(xs[1].x == 3);
}
+// https://issues.dlang.org/show_bug.cgi?id=22105
+@system unittest
+{
+ struct NoDefaultCtor
+ {
+ @disable this();
+ }
+
+ NoDefaultCtor[1] array = void;
+ static assert(!__traits(compiles, array[].initializeAll));
+}
+
// move
/**
Moves `source` into `target`, via a destructive copy when necessary.