Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

yurivict opened this issue Dec 3, 2014 · 5 comments
Assignees
Labels
ABI Application Binary Interface bugzilla Issues migrated from bugzilla libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. wontfix Issue is real, but we can't or won't fix it. Not invalid

Comments

@yurivict
Copy link

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 commented Dec 3, 2014

assigned to @mclow

@mclow
Copy link
Contributor

mclow commented Dec 3, 2014

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

@yurivict
Copy link
Author

yurivict commented Dec 3, 2014

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

@mclow
Copy link
Contributor

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.

@mclow
Copy link
Contributor

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".

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
@Quuxplusone Quuxplusone added the wontfix Issue is real, but we can't or won't fix it. Not invalid label Jan 20, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ABI Application Binary Interface bugzilla Issues migrated from bugzilla libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. wontfix Issue is real, but we can't or won't fix it. Not invalid
Projects
None yet
Development

No branches or pull requests

3 participants