flang-compiler / f18

F18 is a front-end for Fortran intended to replace the existing front-end in the Flang compiler
230 stars 48 forks source link

Add message formatting for std::int64_t #1101

Closed tskeith closed 4 years ago

tskeith commented 4 years ago

There is no printf formatting string for std::int64_t. Instead we have to cast to std::intmax_t and use %jd. This change simplifies that by automatically converting std::int64_t to std::intmax_twhen formatting messages.

This follows the pattern of std::string and parser::CharBlock, which are formatted with %s.

tskeith commented 4 years ago

Might as well catch and convert uint64_t too, for that type and size_t, for the %z formats.

I've added a conversion from std::uint64_t to std::uintmax_t. We don't have any instances of that yet, but we may someday.