[Bug c++/80662] libstdc++ basic_string casting oddity

2022-01-07 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80662 --- Comment #8 from Jonathan Wakely --- FWIW the original example compiles now, but that's because https://wg21.link/lwg1203 (implemented by r12-319 and in gcc 11.2 by r11-8369) changed the return type to be a reference to the original stream, n

[Bug c++/80662] libstdc++ basic_string casting oddity

2022-01-07 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80662 --- Comment #7 from Jonathan Wakely --- EDG matches GCC with --g++ (which is what ICC uses) but in it's strict mode it says they're ambiguous: "s.C", line 13: error: more than one operator "<<" matches these operands: function templa

[Bug c++/80662] libstdc++ basic_string casting oddity

2022-01-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80662 --- Comment #6 from Andrew Pinski --- (In reply to Jonathan Wakely from comment #5) > Reduced thanks to K-ballo: Hmm, clang compiles and gives: member While both GCC and ICC compiles and gives: non-member And MSVC rejects it with: (15): erro

[Bug c++/80662] libstdc++ basic_string casting oddity

2017-05-08 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80662 --- Comment #5 from Jonathan Wakely --- Reduced thanks to K-ballo: extern "C" int puts(const char*); template void operator<<(C&&, T const&) { puts("non-member"); } struct my_stream { template void operator<<(T&&) { puts("member"); }

[Bug c++/80662] libstdc++ basic_string casting oddity

2017-05-08 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80662 Jonathan Wakely changed: What|Removed |Added Component|libstdc++ |c++ --- Comment #4 from Jonathan Wakel