public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "witold.baryluk+gcc at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug d/98457] [d] writef!"%s" doesn't work with MonoTime / SysTick
Date: Sun, 27 Dec 2020 23:58:21 +0000	[thread overview]
Message-ID: <bug-98457-4-7faFAzhm3a@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98457-4@http.gcc.gnu.org/bugzilla/>

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

  reply	other threads:[~2020-12-27 23:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-27 23:56 [Bug d/98457] New: " witold.baryluk+gcc at gmail dot com
2020-12-27 23:58 ` witold.baryluk+gcc at gmail dot com [this message]
2021-04-19 15:29 ` [Bug d/98457] " ibuclaw at gdcproject dot org
2021-04-19 17:29 ` cvs-commit at gcc dot gnu.org
2021-04-19 20:42 ` cvs-commit at gcc dot gnu.org
2021-04-19 20:42 ` cvs-commit at gcc dot gnu.org
2021-04-19 20:49 ` ibuclaw at gdcproject dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-98457-4-7faFAzhm3a@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).