-
Notifications
You must be signed in to change notification settings - Fork 16.5k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillalibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Description
| Bugzilla Link | 42166 |
| Resolution | FIXED |
| Resolved on | Jun 10, 2019 14:14 |
| Version | unspecified |
| OS | All |
| CC | @ivafanas,@lichray,@mclow,@jwakely |
Extended Description
Given the following code:
#include
#include
#include
template
void test()
{
char buf[100];
auto res = std::to_chars(buf, buf + 100, (T)0xffffffff);
assert(res.ec == std::errc());
*res.ptr = '\0';
std::cout << (const char *) buf << std::endl;
}
int main ()
{
test();
test();
test<int64_t>();
test<unsigned int>();
test<unsigned long>();
test<uint64_t>();
}
I expect this to print:
-1
4294967295
4294967295
4294967295
4294967295
4294967295
but instead it prints:
-1
0004294967295
0004294967295
4294967295
0004294967295
0004294967295
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillalibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.