You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
libcxx_old/test/std/utilities/charconv
Zhihao Yuan 5a466fcca7 [libc++] Fix leading zeros in std::to_chars
Summary:
It is a bugfix proposal for https://bugs.llvm.org/show_bug.cgi?id=42166.

`std::to_chars` appends leading zeros if input 64-bit value has 9, 10 or 11 digits.
According to documentation `std::to_chars` must not append leading zeros:
https://en.cppreference.com/w/cpp/utility/to_chars

Changeset should not affect `std::to_chars` performance:
http://quick-bench.com/CEpRs14xxA9WLvkXFtaJ3TWOVAg

Unit test that `std::from_chars` supports compatibility for both `std::to_chars` outputs (previous and fixed one) already exists:
1f60111b59/test/std/utilities/charconv/charconv.from.chars/integral.pass.cpp (L63)

Reviewers: lichray, mclow.lists, ldionne, EricWF

Reviewed By: lichray, mclow.lists

Subscribers: zoecarver, christof, dexonsmith, libcxx-commits

Differential Revision: https://reviews.llvm.org/D63047

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@362967 91177308-0d34-0410-b5e6-96231b3b80d8
6 years ago
..
charconv.from.chars Add include for 'test_macros.h' to all the tests that were missing them. Thanks to Zoe for the (big, but simple) patch. NFC intended. 6 years ago
charconv.to.chars [libc++] Fix leading zeros in std::to_chars 6 years ago