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

Implement LWG-2381 Inconsistency in parsing floating point numbers #3364

Merged
merged 67 commits into from
May 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
5c5ff34
Implement LWG-2381
frederick-vs-ja Jan 27, 2023
c6f272a
Test coverage for LWG-2381
frederick-vs-ja Jan 27, 2023
7d572f1
Update references to WD to WG21-N4928
frederick-vs-ja Jan 27, 2023
e28c00d
Add comments for derivation and remove `std::`
frederick-vs-ja Jan 27, 2023
5b7322c
Missing clang-format
frederick-vs-ja Jan 27, 2023
2fce167
Handle some test errors
frederick-vs-ja Jan 27, 2023
22260ca
Handle "0" and name shadowing
frederick-vs-ja Jan 27, 2023
df459f9
Remove possibly superfluous zero-setting
frederick-vs-ja Jan 27, 2023
432e045
Update references to WD and fix a comment
frederick-vs-ja Jan 27, 2023
49c6e69
Address most of @strega-nil-ms's review comments
frederick-vs-ja Jan 28, 2023
b44b9a0
Address grouping and multi-def issues
frederick-vs-ja Jan 28, 2023
38151c1
Revert unintended line-breaking
frederick-vs-ja Jan 28, 2023
f51e837
Merge branch 'microsoft:main' into lwg-2381
frederick-vs-ja Jan 28, 2023
f7eb879
Don't default-initialize `_Current_grouping_count`
frederick-vs-ja Jan 28, 2023
ac30e4c
Avoid signedness issues
frederick-vs-ja Jan 28, 2023
18696e1
Fix typo in the directory name!
frederick-vs-ja Jan 28, 2023
1c63310
Small cleanups
frederick-vs-ja Jan 30, 2023
5fd6dd6
Address GH-3376
frederick-vs-ja Feb 2, 2023
b4162ee
Test coverage for GH-3376
frederick-vs-ja Feb 2, 2023
37bf218
Clang-format: strange empty line
frederick-vs-ja Feb 2, 2023
c05bb2e
Unify hex/dec branchs, address GH-3375 and GH-3378
frederick-vs-ja Feb 2, 2023
877dcd2
`_Leading` is no longer useful, good thing
frederick-vs-ja Feb 2, 2023
6ca7cac
`*_Ptr = '\0';` was accidently dropped
frederick-vs-ja Feb 2, 2023
19f635e
Make `_Offset_*` constants have type `size_t`
frederick-vs-ja Feb 2, 2023
c299d2b
Clang-format (again)
frederick-vs-ja Feb 2, 2023
6bd5d5a
Fix a copy-pasta to correct handling for hex rep
frederick-vs-ja Feb 2, 2023
f17b6fe
Test coverage for GH-3376 and GH-3378
frederick-vs-ja Feb 2, 2023
4b2476c
Merge branch 'microsoft:main' into lwg-2381
frederick-vs-ja Feb 3, 2023
e6a6076
Update notes for skipping/failure
frederick-vs-ja Feb 8, 2023
5375be3
Merge branch 'main' into lwg-2381
StephanTLavavej Feb 14, 2023
492b1b3
Drop misreported LLVM-60597 from the comments
frederick-vs-ja Feb 15, 2023
1814ec8
Merge branch 'main' into lwg-2381
CaseyCarter Feb 21, 2023
19bd0e9
Merge branch 'microsoft:main' into lwg-2381
frederick-vs-ja Mar 12, 2023
f54bbf5
Merge branch 'main' into lwg-2381
StephanTLavavej Apr 7, 2023
fa90c01
Update and correct citations.
StephanTLavavej Apr 7, 2023
220200d
Adjust newlines.
StephanTLavavej Apr 7, 2023
dc3b17a
Drop `std::`.
StephanTLavavej Apr 7, 2023
fe659a1
Include `<utility>`.
StephanTLavavej Apr 7, 2023
42ebf6e
Use `override` by itself.
StephanTLavavej Apr 7, 2023
cfff234
`bool(stream)` => `static_cast<bool>(stream)`
StephanTLavavej Apr 7, 2023
40a8d36
Fix comment typo.
StephanTLavavej Apr 7, 2023
3cf000d
Make comment vendor-neutral.
StephanTLavavej Apr 7, 2023
700e4c6
Add LLVM banner.
StephanTLavavej Apr 7, 2023
d2f9aa3
`0X or 0x` => `0x or 0X`
StephanTLavavej Apr 7, 2023
61784c9
Consistently test `_Significant >= _Max_sig_dig`.
StephanTLavavej Apr 7, 2023
60a42cf
Use decimal literals for all offsets.
StephanTLavavej Apr 7, 2023
09698d1
`_Base` => `_Pten`
StephanTLavavej Apr 7, 2023
8514599
Locally scope `size_t _Idx`.
StephanTLavavej Apr 7, 2023
f1920f9
Merge branch 'main' into lwg-2381
StephanTLavavej Apr 7, 2023
1362134
Merge branch 'main' into lwg-2381
frederick-vs-ja Apr 19, 2023
98e6a5e
Address review comments
frederick-vs-ja Apr 19, 2023
721ed3f
Missing Clang-format
frederick-vs-ja Apr 19, 2023
24c65d5
No narrowing!
frederick-vs-ja Apr 19, 2023
602f523
Merge branch 'main' into lwg-2381
frederick-vs-ja Apr 21, 2023
0dd8f17
Strengthen tests for GH-1582 and exception specification
frederick-vs-ja Apr 21, 2023
5a2bfb2
Fix stable name.
StephanTLavavej Apr 26, 2023
a278ae3
Use `const auto& _Ctype_fac` for consistency.
StephanTLavavej Apr 26, 2023
a4c24d5
Delay `const auto& _Punct_fac` until we need it.
StephanTLavavej Apr 26, 2023
9dd77bd
Use `_Grouping_iter`.
StephanTLavavej Apr 26, 2023
428e36d
Add newlines between non-chained if-statements.
StephanTLavavej Apr 26, 2023
ee40b66
Use a string UDL for consistency.
StephanTLavavej Apr 26, 2023
69d4d59
Add spaces to comments.
StephanTLavavej Apr 26, 2023
5d21b8a
Drop `std` qualification.
StephanTLavavej Apr 26, 2023
7781f2e
Avoid changing the dllexport surface.
StephanTLavavej Apr 27, 2023
ef003c6
Merge branch 'main' into lwg-2381
frederick-vs-ja May 3, 2023
6ce6f9e
Fix handling of `"0\n"` and add test coverage
frederick-vs-ja May 3, 2023
183192d
Split functions in the test file
frederick-vs-ja May 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stl/inc/xlocmon
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ protected:
const char* _Eb = _Str.c_str();
char* _Ep;
int _Errno = 0;
const long double _Ans = _Stodx_v2(_Eb, &_Ep, 0, &_Errno); // convert and "widen" double to long double
const long double _Ans = _Stodx_v3(_Eb, &_Ep, &_Errno); // convert and "widen" double to long double

if (_Ep == _Eb || _Errno != 0) {
_State |= ios_base::failbit;
Expand Down
553 changes: 254 additions & 299 deletions stl/inc/xlocnum

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions tests/libcxx/expected_results.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ std/language.support/support.limits/support.limits.general/ranges.version.compil
# libc++ is missing various <format> DRs
std/language.support/support.limits/support.limits.general/format.version.compile.pass.cpp FAIL

# libc++ doesn't implement LWG-2381
std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp FAIL
std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp FAIL

# libc++ doesn't implement LWG-3670
std/ranges/range.factories/range.iota.view/iterator/member_typedefs.compile.pass.cpp FAIL

Expand Down Expand Up @@ -444,11 +448,6 @@ std/containers/sequences/array/array.swap/swap.fail.cpp FAIL
std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp FAIL
std/algorithms/alg.sorting/alg.min.max/minmax_init_list_comp.pass.cpp FAIL

# GH-1259 <locale>: wrong field extraction for hexfloats, or special cases like inf
std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp FAIL
std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp FAIL
std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_double.pass.cpp FAIL

# GH-1277 <xlocnum>: We don't match numpunct groups correctly in do_get
std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long.pass.cpp FAIL

Expand Down Expand Up @@ -674,6 +673,9 @@ std/time/time.clock/time.clock.file/to_from_sys.pass.cpp FAIL
# libc++'s filesystem::path::iterator models bidirectional_iterator, which is not guaranteed by the Standard
std/input.output/filesystems/class.path/range_concept_conformance.compile.pass.cpp FAIL

# libc++ assumes long double is at least 80-bit; also affected by LWG-2381
std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_double.pass.cpp FAIL

# MaybePOCCAAllocator doesn't meet the allocator requirements
std/containers/sequences/vector/vector.cons/assign_copy.pass.cpp FAIL

Expand Down
1 change: 1 addition & 0 deletions tests/std/test.lst
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ tests\GH_003105_piecewise_densities
tests\GH_003119_error_category_ctor
tests\GH_003246_cmath_narrowing
tests\GH_003617_vectorized_meow_element
tests\LWG2381_num_get_floating_point
tests\LWG2597_complex_branch_cut
tests\LWG3018_shared_ptr_function
tests\LWG3121_constrained_tuple_forwarding_ctor
Expand Down
4 changes: 4 additions & 0 deletions tests/std/tests/LWG2381_num_get_floating_point/env.lst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_matrix.lst
Loading