Skip to content
This repository has been archived by the owner. It is now read-only.

128-bit integers printing not supported in stl implementation #21715

Closed
yurivict opened this issue Dec 3, 2014 · 5 comments
Closed

128-bit integers printing not supported in stl implementation #21715

yurivict opened this issue Dec 3, 2014 · 5 comments

Comments

@yurivict
Copy link

@yurivict yurivict commented Dec 3, 2014

Bugzilla Link 21715
Resolution WONTFIX
Resolved on Feb 07, 2019 10:07
Version unspecified
OS All
CC @mclow,@zygoloid

Extended Description

---testcase---
#include

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') 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);

@yurivict
Copy link
Author

@yurivict yurivict commented Dec 3, 2014

assigned to @mclow

Loading

@mclow
Copy link

@mclow mclow commented Dec 3, 2014

Note - you get the same behavior with libstdc++ (gcc 4.9.2)

Loading

@yurivict
Copy link
Author

@yurivict yurivict commented Dec 3, 2014

I know, thanks. But llvm should be ahead of the game -)

Loading

@mclow
Copy link

@mclow mclow commented Dec 8, 2014

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.

Loading

@mclow
Copy link

@mclow mclow commented Feb 7, 2019

Looking back, four years later.
We're not going to do this. This is not worth an ABI break.

Closing as "Wontfix".

Loading

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants