We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://godbolt.org/z/R2rR5j
#define FMT_HEADER_ONLY #include <fmt/printf.h> struct foo { enum fooEnum { test }; fooEnum i; }; int main() { volatile foo f; printf("%d", f.i); std::string s = fmt::sprintf("%d", f.i); // }
gives:
/opt/compiler-explorer/libs/fmt/6.1.0/include/fmt/core.h: In instantiation of 'fmt::v6::internal::value<Context>::value(const T&) [with T = volatile foo::fooEnum; Context = fmt::v6::basic_printf_context<std::back_insert_iterator<fmt::v6::internal::buffer<char> >, char>]': /opt/compiler-explorer/libs/fmt/6.1.0/include/fmt/core.h:1122:39: required from 'fmt::v6::internal::value<Context> fmt::v6::internal::make_arg(const T&) [with bool IS_PACKED = true; Context = fmt::v6::basic_printf_context<std::back_insert_iterator<fmt::v6::internal::buffer<char> >, char>; T = volatile foo::fooEnum; typename std::enable_if<IS_PACKED, int>::type <anonymous> = 0]' /opt/compiler-explorer/libs/fmt/6.1.0/include/fmt/core.h:1212:58: required from 'fmt::v6::format_arg_store<Context, Args>::format_arg_store(const Args& ...) [with Context = fmt::v6::basic_printf_context<std::back_insert_iterator<fmt::v6::internal::buffer<char> >, char>; Args = {volatile foo::fooEnum}]' /opt/compiler-explorer/libs/fmt/6.1.0/include/fmt/core.h:1226:18: required from 'fmt::v6::format_arg_store<Context, Args ...> fmt::v6::make_format_args(const Args& ...) [with Context = fmt::v6::basic_printf_context<std::back_insert_iterator<fmt::v6::internal::buffer<char> >, char>; Args = {volatile foo::fooEnum}]' /opt/compiler-explorer/libs/fmt/6.1.0/include/fmt/printf.h:618:77: required from 'std::basic_string<Char> fmt::v6::sprintf(const S&, const Args& ...) [with S = char [3]; Args = {volatile foo::fooEnum}; Char = char]' <source>:15:43: required from here /opt/compiler-explorer/libs/fmt/6.1.0/include/fmt/core.h:798:18: error: invalid conversion from 'const volatile void*' to 'const void*' [-fpermissive] custom.value = &val;
The text was updated successfully, but these errors were encountered:
Should be fixed in f72a905. Thanks for reporting.
Sorry, something went wrong.
This also fixed: https://godbolt.org/z/GW7G_9
enum class Foo { somevalue }; int main() { Foo f{}; printf("%d", f); std::string s = fmt::sprintf("%d", f); }
No branches or pull requests
https://godbolt.org/z/R2rR5j
gives:
The text was updated successfully, but these errors were encountered: