Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/core/internal/string.d
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ char[] unsignedToTempString()(ulong value, return scope char[] buf, uint radix =
return buf[i .. $];
}

private struct TempStringNoAlloc
private struct TempStringNoAlloc()
{
// need to handle 65 bytes for radix of 2 with negative sign.
private char[65] _buf = void;
Expand All @@ -79,7 +79,7 @@ Returns:
*/
auto unsignedToTempString()(ulong value, uint radix = 10) @safe
{
TempStringNoAlloc result = void;
TempStringNoAlloc!() result = void;
result._len = unsignedToTempString(value, result._buf, radix).length & 0xff;
return result;
}
Expand Down
2 changes: 1 addition & 1 deletion test/betterc/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../common.mak

TESTS:=test18828 test19416 test19421 test19561
TESTS:=test18828 test19416 test19421 test19561 test20088

.PHONY: all clean
all: $(addprefix $(ROOT)/,$(addsuffix ,$(TESTS)))
Expand Down
14 changes: 14 additions & 0 deletions test/betterc/src/test20088.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*******************************************/
// https://issues.dlang.org/show_bug.cgi?id=20088

struct S {
int i;
}

extern(C) int main() @nogc nothrow pure
{
S[2] s = [S(1),S(2)];
void[] v = cast(void[])s;
S[] p = cast(S[])v; // cast of void[] to S[] triggers __ArrayCast template function
return 0;
}