You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following snippet fails to compile with any recent gcc version.
#include <type_traits>
#include <fmt/format.h>
struct Test {};
namespace fmt {
template<>
struct formatter<Test> : formatter<int> {
template <typename FormatContext>
auto format(const Test&, FormatContext &ctx) {
return formatter<int>::format(42, ctx);
}
};
}
// When moved on top of the specialization, it works fine:
#include <fmt/ostream.h>
The error message is
fmt/ostream.h:115:45: error: partial specialization of 'struct fmt::v5::convert_to_int<T, Char, void>' after instantiation of 'struct fmt::v5::convert_to_int<int, char, void>' [-fpermissive]
template <typename T, typename Char> struct convert_to_int<T, Char, void> {
Contrary, clang happily compiles this. See godbolt.
Thanks in advance for having a look! I could also try to fix it, but not today at least :)
The text was updated successfully, but these errors were encountered:
The following snippet fails to compile with any recent gcc version.
The error message is
Contrary, clang happily compiles this. See godbolt.
Thanks in advance for having a look! I could also try to fix it, but not today at least :)
The text was updated successfully, but these errors were encountered: