From b6df113247b9f3f7c3db0e65c481dad5bcfddfb4 Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Tue, 26 Jul 2022 17:42:23 +0200 Subject: d: Merge upstream dmd d7772a2369, phobos 5748ca43f. In upstream dmd, the compiler front-end and run-time have been merged together into one repository. Both dmd and libdruntime now track that. D front-end changes: - Deprecated `scope(failure)' blocks that contain `return' statements. - Deprecated using integers for `version' or `debug' conditions. - Deprecated returning a discarded void value from a function. - `new' can now allocate an associative array. D runtime changes: - Added avx512f detection to core.cpuid module. Phobos changes: - Changed std.experimental.logger.core.sharedLog to return shared(Logger). gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd d7772a2369. * dmd/VERSION: Bump version to v2.100.1. * d-codegen.cc (get_frameinfo): Check whether decision to generate closure changed since semantic finished. * d-lang.cc (d_handle_option): Remove handling of -fdebug=level and -fversion=level. * decl.cc (DeclVisitor::visit (VarDeclaration *)): Generate evaluation of noreturn variable initializers before throw. * expr.cc (ExprVisitor::visit (AssignExp *)): Don't generate assignment for noreturn types, only evaluate for side effects. * lang.opt (fdebug=): Undocument -fdebug=level. (fversion=): Undocument -fversion=level. libphobos/ChangeLog: * configure: Regenerate. * configure.ac (libtool_VERSION): Update to 4:0:0. * libdruntime/MERGE: Merge upstream druntime d7772a2369. * libdruntime/Makefile.am (DRUNTIME_DSOURCES): Add core/internal/array/duplication.d. * libdruntime/Makefile.in: Regenerate. * src/MERGE: Merge upstream phobos 5748ca43f. * testsuite/libphobos.gc/nocollect.d: --- libphobos/src/std/format/package.d | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'libphobos/src/std/format/package.d') diff --git a/libphobos/src/std/format/package.d b/libphobos/src/std/format/package.d index 76d68f6cff6..3f6f33adf6e 100644 --- a/libphobos/src/std/format/package.d +++ b/libphobos/src/std/format/package.d @@ -1356,6 +1356,30 @@ if (isSomeChar!Char) assert(result == " 1"); } +// https://issues.dlang.org/show_bug.cgi?id=23245 +@safe unittest +{ + static struct S + { + string toString() { return "S"; } + } + + S[1] s; + assert(format("%s", s) == "[S]"); +} + +// https://issues.dlang.org/show_bug.cgi?id=23246 +@safe unittest +{ + static struct S + { + string toString() { return "S"; } + } + + S[int] s = [0 : S()]; + assert(format("%s", s) == "[0:S]"); +} + /// ditto typeof(fmt) format(alias fmt, Args...)(Args args) if (isSomeString!(typeof(fmt))) -- cgit v1.2.1