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
#include <fmt/ostream.h>
#include <iostream>
namespace something{ struct Custom {}; }
std::ostream& operator<<(std::ostream& os, const something::Custom&)
{
return os << "Ok";
}
int main()
{
// Compiles with Gcc and Clang
std::cout << something::Custom() << '\n';
// Compiles with Gcc, but not Clang
fmt::print("{}\n", something::Custom());
}
I don't know if this is a compiler bug, but it seems that clang + libfmt = operator<< not found.
The absurd thing is that it compiles (with both compilers, also the non-libfmt example) if I move operator<< into the namespace. That is not supposed to compile (if my understanding of argument dependent lookup is correct) – I learned this from the exact opposite experience.
I have basically #952 (comment) with a namespace:
I don't know if this is a compiler bug, but it seems that clang + libfmt =
operator<<
not found.The absurd thing is that it compiles (with both compilers, also the non-libfmt example) if I move
operator<<
into the namespace. That is not supposed to compile (if my understanding of argument dependent lookup is correct) – I learned this from the exact opposite experience.Libfmt tested:
Compilers tested:
The text was updated successfully, but these errors were encountered: