---testcase--- #include <sstream> int main() { std::ostringstream ss; __int128 i = 10; ss << i; } ---errors--- i128.C:7:6: error: use of overloaded operator '<<' is ambiguous (with operand types 'std::ostringstream' (aka 'basic_ostringstream<char>') and '__int128') ss << i; ~~ ^ ~ /usr/include/c++/v1/ostream:183:20: note: candidate function basic_ostream& operator<<(bool __n); ^ /usr/include/c++/v1/ostream:184:20: note: candidate function basic_ostream& operator<<(short __n); ^ /usr/include/c++/v1/ostream:185:20: note: candidate function basic_ostream& operator<<(unsigned short __n); ^ /usr/include/c++/v1/ostream:186:20: note: candidate function basic_ostream& operator<<(int __n); ^ /usr/include/c++/v1/ostream:187:20: note: candidate function basic_ostream& operator<<(unsigned int __n);
Note - you get the same behavior with libstdc++ (gcc 4.9.2)
I know, thanks. But llvm should be ahead of the game -)
A couple more comments. 1) This requires an ABI change - specifically, adding two additional virtual overloads to std::num_put::do_put. 2) libc++ uses the underlying C library call sprintf (or sprintf_l, if available) to do the actual conversion. I don't think too many C libraries support this yet.
Looking back, four years later. We're not going to do this. This is not worth an ABI break. Closing as "Wontfix".