https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98457
--- Comment #1 from Witold Baryluk <witold.baryluk+gcc at gmail dot com> --- Godbolt link: https://godbolt.org/z/q3bzhP with gcc trunk 20201217 and a bit more diagnostic /opt/compiler-explorer/gcc-trunk-20201227/lib/gcc/x86_64-linux-gnu/11.0.0/include/d/core/time.d:2405:16: error: static variable _ticksPerSecond cannot be read at compile time 2405 | return _ticksPerSecond[_clockIdx]; | ^ /opt/compiler-explorer/gcc-trunk-20201227/lib/gcc/x86_64-linux-gnu/11.0.0/include/d/core/time.d:2418:99: note: called from here: ticksPerSecond() 2418 | return "MonoTime(" ~ signedToTempString(_ticks, 10) ~ " ticks, " ~ signedToTempString(ticksPerSecond, 10) ~ " ticks per second)"; | ^ /opt/compiler-explorer/gcc-trunk-20201227/lib/gcc/x86_64-linux-gnu/11.0.0/include/d/core/time.d:2418:98: note: called from here: signedToTempString(ticksPerSecond(), 10u) 2418 | return "MonoTime(" ~ signedToTempString(_ticks, 10) ~ " ticks, " ~ signedToTempString(ticksPerSecond, 10) ~ " ticks per second)"; | ^ /opt/compiler-explorer/gcc-trunk-20201227/lib/gcc/x86_64-linux-gnu/11.0.0/include/d/std/format.d:3353:28: note: called from here: val.toString() 3353 | put(w, val.toString()); | ^ /opt/compiler-explorer/gcc-trunk-20201227/lib/gcc/x86_64-linux-gnu/11.0.0/include/d/std/format.d:3353:12: note: called from here: put(w, val.toString()) 3353 | put(w, val.toString()); | ^ /opt/compiler-explorer/gcc-trunk-20201227/lib/gcc/x86_64-linux-gnu/11.0.0/include/d/std/format.d:3672:21: note: called from here: formatObject(w, val, f) 3672 | formatObject(w, val, f); | ^ /opt/compiler-explorer/gcc-trunk-20201227/lib/gcc/x86_64-linux-gnu/11.0.0/include/d/std/format.d:568:28: note: called from here: formatValue(w, _param_2, spec) 568 | formatValue(w, args[i], spec); | ^ /opt/compiler-explorer/gcc-trunk-20201227/lib/gcc/x86_64-linux-gnu/11.0.0/include/d/std/format.d:5767:28: note: called from here: formattedWrite(w, fmt, _param_1) 5767 | auto n = formattedWrite(w, fmt, args); | ^ /opt/compiler-explorer/gcc-trunk-20201227/lib/gcc/x86_64-linux-gnu/11.0.0/include/d/std/format.d:5729:16: note: called from here: format("%s", MonoTimeImpl(0L)) 5729 | .format(fmt, Args.init); | ^ /opt/compiler-explorer/gcc-trunk-20201227/lib/gcc/x86_64-linux-gnu/11.0.0/include/d/std/format.d:5733:2: note: called from here: (*function () => null)() 5733 | }(); | ^ /opt/compiler-explorer/gcc-trunk-20201227/lib/gcc/x86_64-linux-gnu/11.0.0/include/d/std/stdio.d:3754:15: error: template instance std.format.checkFormatException!("�}�", MonoTimeImpl!cast(ClockType)0) error instantiating 3754 | alias e = checkFormatException!(fmt, A); | ^ <source>:4:14: note: instantiated from here: writef!("%s", MonoTimeImpl!cast(ClockType)0) 4 | writef!"%s"(MonoTime.currTime()); | ^ /opt/compiler-explorer/gcc-trunk-20201227/lib/gcc/x86_64-linux-gnu/11.0.0/include/d/std/stdio.d:3755:5: note: while evaluating: static assert(!e) 3755 | static assert(!e, e.msg); | ^ Compiler returned: 1