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

Use constexpr is_sorted, add charconv tests, update comments #1278

Merged
merged 9 commits into from
Sep 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 11 additions & 12 deletions stl/inc/execution
Original file line number Diff line number Diff line change
Expand Up @@ -1091,8 +1091,7 @@ struct _Static_partitioned_all_of_family2 { // all_of/any_of/none_of task schedu
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
// GH-818: https://github.com/microsoft/STL/issues/818
// Once _Key is obtained, the amount of work should not be discarded (see GH-818).

const auto _Range = _Basis._Get_chunk(_Key);
for (auto _First = _Range._First; _First != _Range._Last; ++_First) {
Expand Down Expand Up @@ -1326,7 +1325,7 @@ struct _Static_partitioned_find2 {
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
// Once _Key is obtained, the amount of work should not be discarded (see GH-818).

const auto _Range = _Basis._Get_chunk(_Key);
const auto _This_find = _Fx(_Range._First, _Range._Last);
Expand Down Expand Up @@ -1531,7 +1530,7 @@ struct _Static_partitioned_find_end_backward2 {
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
// Once _Key is obtained, the amount of work should not be discarded (see GH-818).

const auto _Chunk_number = _Key._Chunk_number;
const auto _Range = _Basis._Get_chunk(_Key);
Expand Down Expand Up @@ -1652,7 +1651,7 @@ struct _Static_partitioned_adjacent_find2 {
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
// Once _Key is obtained, the amount of work should not be discarded (see GH-818).

const auto _Chunk_number = _Key._Chunk_number;
const auto _Range = _Basis._Get_chunk(_Key);
Expand Down Expand Up @@ -1868,7 +1867,7 @@ struct _Static_partitioned_mismatch2 {
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
// Once _Key is obtained, the amount of work should not be discarded (see GH-818).

const auto _Chunk_number = _Key._Chunk_number;
const auto _Range1 = _Basis1._Get_chunk(_Key);
Expand Down Expand Up @@ -2000,7 +1999,7 @@ struct _Static_partitioned_equal2 {
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
// Once _Key is obtained, the amount of work should not be discarded (see GH-818).

const auto _Range1 = _Basis1._Get_chunk(_Key);
const auto _Range2_first = _Basis2._Get_chunk(_Key)._First;
Expand Down Expand Up @@ -2119,7 +2118,7 @@ struct _Static_partitioned_search2 {
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
// Once _Key is obtained, the amount of work should not be discarded (see GH-818).

const auto _Range = _Basis._Get_chunk(_Key);
for (auto _Candidate = _Range._First; _Candidate != _Range._Last; ++_Candidate) {
Expand Down Expand Up @@ -2238,7 +2237,7 @@ struct _Static_partitioned_search_n2 {
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
// Once _Key is obtained, the amount of work should not be discarded (see GH-818).

const auto _Range = _Basis._Get_chunk(_Key);

Expand Down Expand Up @@ -3069,7 +3068,7 @@ struct _Static_partitioned_is_sorted_until {
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
// Once _Key is obtained, the amount of work should not be discarded (see GH-818).

auto _Range = _Basis._Get_chunk(_Key);
auto _Next = _Range._First;
Expand Down Expand Up @@ -3184,7 +3183,7 @@ struct _Static_partitioned_is_partitioned {
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
// Once _Key is obtained, the amount of work should not be discarded (see GH-818).

// looking at chunks from either end, moving in towards the middle
auto _Target_chunk_number = _Key._Chunk_number >> 1;
Expand Down Expand Up @@ -3297,7 +3296,7 @@ struct _Static_partitioned_is_heap_until {
if (!_Key) {
return _Cancellation_status::_Canceled;
}
// Once _Key is obtained, the amount of work should not be discarded; see GH-818.
// Once _Key is obtained, the amount of work should not be discarded (see GH-818).

const auto _Chunk_range_size = _Key._Size;
const auto _Chunk_offset = _Key._Start_at;
Expand Down
44 changes: 23 additions & 21 deletions tests/libcxx/expected_results.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ std/numerics/bit/bit.pow.two/log2p1.pass.cpp FAIL
# test emits warning C4310: cast truncates constant value
std/numerics/bit/bitops.rot/rotl.pass.cpp:0 FAIL


# *** INTERACTIONS WITH CONTEST / C1XX THAT UPSTREAM LIKELY WON'T FIX ***
# Tracked by VSO-593630 "<filesystem> Enable libcxx filesystem tests"
# rapid-cxx-test.hpp uses pragma system_header
Expand Down Expand Up @@ -486,10 +487,10 @@ std/thread/futures/futures.task/futures.task.members/make_ready_at_thread_exit.p


# *** C1XX COMPILER BUGS ***
# Compiler bug: DevCom-409222 "Constructing rvalue reference from non-reference-related lvalue reference"
# DevCom-409222 "Constructing rvalue reference from non-reference-related lvalue reference"
std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp:0 FAIL

# Compiler bug: DevCom-876860 "conditional operator errors" blocks readable<volatile int*>.
# DevCom-876860 "conditional operator errors" blocks readable<volatile int*>.
std/containers/views/span.cons/ptr_len.pass.cpp:0 FAIL
std/containers/views/span.cons/ptr_ptr.pass.cpp:0 FAIL

Expand Down Expand Up @@ -519,10 +520,10 @@ std/language.support/support.limits/limits/numeric.limits.members/traps.pass.cpp


# *** STL BUGS ***
# STL bug: VSO-121977 "<locale>: the enum value of std::money_base is not correct[libcxx]"
# GH-1112 <locale>: the enum value of std::money_base is not correct
std/localization/locale.categories/category.monetary/locale.moneypunct/money_base.pass.cpp FAIL

# STL Bug: VSO-595631 <fstream> basic_filebuf doesn't comply with setbuf(0,0) requirement in the standard
# GH-1113 <fstream>: basic_filebuf doesn't comply with setbuf(0,0) requirement in the standard
std/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp FAIL
std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp FAIL

Expand All @@ -531,37 +532,38 @@ std/numerics/complex.number/complex.special/double_long_double_implicit.compile.
std/numerics/complex.number/complex.special/float_double_implicit.compile.fail.cpp FAIL
std/numerics/complex.number/complex.special/float_long_double_implicit.compile.fail.cpp FAIL

# STL bug: regex_traits::transform() isn't following the Standard.
# GH-1004 <regex>: Error C2664 in std::regex_traits::transform
std/re/re.traits/transform.pass.cpp FAIL

# STL bug: Incorrect return types.
# GH-1260 <complex>: pow, incorrect type conversion
std/numerics/complex.number/cmplx.over/pow.pass.cpp FAIL

# STL bug: We allow fill() and swap() for array<const T, 0>.
# GH-1295 <array>: array<const T, 0> allows fill() and swap()
StephanTLavavej marked this conversation as resolved.
Show resolved Hide resolved
std/containers/sequences/array/array.fill/fill.fail.cpp FAIL
std/containers/sequences/array/array.swap/swap.fail.cpp FAIL

# STL bug: VSO-207715 We reject array<NoDefault, 0>.
# GH-942 <array>: std::array<T,0> doesn't compile - when type is not default constructible
std/containers/sequences/array/array.cons/implicit_copy.pass.cpp FAIL
std/containers/sequences/array/array.cons/initialization.pass.cpp FAIL
std/containers/sequences/array/array.data/data_const.pass.cpp FAIL
std/containers/sequences/array/array.data/data.pass.cpp FAIL
std/containers/sequences/array/iterators.pass.cpp FAIL

# Predicate count assertions - IDL2 is slightly bending the Standard's rules here.
# GH-1006 <algorithm>: debug checks for predicates are observable
std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap_comp.pass.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

# STL bug: We don't match strtod / strtof when doing field extraction for hexfloats, or special cases like inf
# 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

# STL bug: We don't match numpunct groups correctly in do_get
# 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

# STL test bug: We don't have the locale names libcxx wants specialized in platform_support.hpp
# GH-1275 <locale>: missing some locale names
# We don't have the locale names libcxx wants specialized in platform_support.hpp
# More bugs may be uncovered when the locale names are present.
# move.pass.cpp can crash.
std/input.output/iostreams.base/ios/basic.ios.members/move.pass.cpp SKIPPED
Expand Down Expand Up @@ -593,22 +595,26 @@ std/localization/locale.categories/category.time/locale.time.put.byname/put1.pas
std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp FAIL
std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp FAIL

# STL Bug? Our wbuffer_convert does not implement seek. [depr.conversions.buffer] is completely underspecified.
# GH-1264 <locale>: wbuffer_convert does not implement seek
std/localization/locales/locale.convenience/conversions/conversions.buffer/seekoff.pass.cpp FAIL

# STL Bug: error_category's default ctor isn't constexpr. (Should be fixed in vNext.)
# GH-1116 <system_error>: error_category's default ctor isn't constexpr.
std/diagnostics/syserr/syserr.errcat/syserr.errcat.nonvirtuals/default_ctor.pass.cpp:1 FAIL

# STL Bug: future incorrectly uses copy assignment instead of copy construction in set_value. (Should be fixed in vNext.)
# GH-1190 <future>: incorrectly used copy assignment instead of copy construction in set_value
std/thread/futures/futures.promise/set_value_const.pass.cpp FAIL

# STL bug: GH-757 <xstring>: Too many enabled hash specializations
# GH-757 <xstring>: Too many enabled hash specializations
std/strings/basic.string.hash/char_type_hash.fail.cpp FAIL
std/strings/string.view/string.view.hash/char_type.hash.fail.cpp FAIL

# STL bug: GH-784 <type_traits>: aligned_storage has incorrect alignment defaults
# GH-784 <type_traits>: aligned_storage has incorrect alignment defaults
std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp FAIL

# GH-519 <cmath>: signbit() misses overloads for integer types
std/depr/depr.c.headers/math_h.pass.cpp FAIL
std/numerics/c.math/cmath.pass.cpp FAIL


# *** CRT BUGS ***
# We're permanently missing aligned_alloc().
Expand All @@ -634,10 +640,6 @@ std/thread/thread.semaphore/try_acquire.pass.cpp FAIL
std/thread/thread.barrier/completion.pass.cpp FAIL
std/thread/thread.barrier/max.pass.cpp FAIL

# Test bug/LEWG issue or STL bug. See GH-519 "<cmath>: signbit() misses overloads for integer types".
std/depr/depr.c.headers/math_h.pass.cpp FAIL
std/numerics/c.math/cmath.pass.cpp FAIL

# Test bug after LWG-2899 "is_(nothrow_)move_constructible and tuple, optional and unique_ptr" was accepted.
std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move_convert.pass.cpp FAIL
std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move_convert.runtime.pass.cpp FAIL
Expand Down
44 changes: 23 additions & 21 deletions tests/libcxx/skipped_tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ numerics\bit\bit.pow.two\log2p1.pass.cpp
# test emits warning C4310: cast truncates constant value
numerics\bit\bitops.rot\rotl.pass.cpp


# *** INTERACTIONS WITH CONTEST / C1XX THAT UPSTREAM LIKELY WON'T FIX ***
# Tracked by VSO-593630 "<filesystem> Enable libcxx filesystem tests"
# rapid-cxx-test.hpp uses pragma system_header
Expand Down Expand Up @@ -486,10 +487,10 @@ thread\futures\futures.task\futures.task.members\make_ready_at_thread_exit.pass.


# *** C1XX COMPILER BUGS ***
# Compiler bug: DevCom-409222 "Constructing rvalue reference from non-reference-related lvalue reference"
# DevCom-409222 "Constructing rvalue reference from non-reference-related lvalue reference"
utilities\meta\meta.unary\meta.unary.prop\is_constructible.pass.cpp

# Compiler bug: DevCom-876860 "conditional operator errors" blocks readable<volatile int*>.
# DevCom-876860 "conditional operator errors" blocks readable<volatile int*>.
containers\views\span.cons\ptr_len.pass.cpp
containers\views\span.cons\ptr_ptr.pass.cpp

Expand Down Expand Up @@ -519,10 +520,10 @@ language.support\support.limits\limits\numeric.limits.members\traps.pass.cpp


# *** STL BUGS ***
# STL bug: VSO-121977 "<locale>: the enum value of std::money_base is not correct[libcxx]"
# GH-1112 <locale>: the enum value of std::money_base is not correct
localization\locale.categories\category.monetary\locale.moneypunct\money_base.pass.cpp

# STL Bug: VSO-595631 <fstream> basic_filebuf doesn't comply with setbuf(0,0) requirement in the standard
# GH-1113 <fstream>: basic_filebuf doesn't comply with setbuf(0,0) requirement in the standard
input.output\file.streams\fstreams\filebuf.virtuals\overflow.pass.cpp
input.output\file.streams\fstreams\filebuf.virtuals\underflow.pass.cpp

Expand All @@ -531,37 +532,38 @@ numerics\complex.number\complex.special\double_long_double_implicit.compile.fail
numerics\complex.number\complex.special\float_double_implicit.compile.fail.cpp
numerics\complex.number\complex.special\float_long_double_implicit.compile.fail.cpp

# STL bug: regex_traits::transform() isn't following the Standard.
# GH-1004 <regex>: Error C2664 in std::regex_traits::transform
re\re.traits\transform.pass.cpp

# STL bug: Incorrect return types.
# GH-1260 <complex>: pow, incorrect type conversion
numerics\complex.number\cmplx.over\pow.pass.cpp

# STL bug: We allow fill() and swap() for array<const T, 0>.
# GH-1295 <array>: array<const T, 0> allows fill() and swap()
containers\sequences\array\array.fill\fill.fail.cpp
containers\sequences\array\array.swap\swap.fail.cpp

# STL bug: VSO-207715 We reject array<NoDefault, 0>.
# GH-942 <array>: std::array<T,0> doesn't compile - when type is not default constructible
containers\sequences\array\array.cons\implicit_copy.pass.cpp
containers\sequences\array\array.cons\initialization.pass.cpp
containers\sequences\array\array.data\data_const.pass.cpp
containers\sequences\array\array.data\data.pass.cpp
containers\sequences\array\iterators.pass.cpp

# Predicate count assertions - IDL2 is slightly bending the Standard's rules here.
# GH-1006 <algorithm>: debug checks for predicates are observable
algorithms\alg.sorting\alg.heap.operations\make.heap\make_heap_comp.pass.cpp
algorithms\alg.sorting\alg.merge\inplace_merge_comp.pass.cpp
algorithms\alg.sorting\alg.min.max\minmax_init_list_comp.pass.cpp

# STL bug: We don't match strtod / strtof when doing field extraction for hexfloats, or special cases like inf
# GH-1259 <locale>: wrong field extraction for hexfloats, or special cases like inf
localization\locale.categories\category.numeric\locale.num.get\facet.num.get.members\get_double.pass.cpp
localization\locale.categories\category.numeric\locale.num.get\facet.num.get.members\get_float.pass.cpp
localization\locale.categories\category.numeric\locale.num.get\facet.num.get.members\get_long_double.pass.cpp

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

# STL test bug: We don't have the locale names libcxx wants specialized in platform_support.hpp
# GH-1275 <locale>: missing some locale names
# We don't have the locale names libcxx wants specialized in platform_support.hpp
# More bugs may be uncovered when the locale names are present.
# move.pass.cpp can crash.
input.output\iostreams.base\ios\basic.ios.members\move.pass.cpp
Expand Down Expand Up @@ -593,22 +595,26 @@ localization\locale.categories\category.time\locale.time.put.byname\put1.pass.cp
localization\locale.categories\facet.numpunct\locale.numpunct.byname\grouping.pass.cpp
localization\locale.categories\facet.numpunct\locale.numpunct.byname\thousands_sep.pass.cpp

# STL Bug? Our wbuffer_convert does not implement seek. [depr.conversions.buffer] is completely underspecified.
# GH-1264 <locale>: wbuffer_convert does not implement seek
localization\locales\locale.convenience\conversions\conversions.buffer\seekoff.pass.cpp

# STL Bug: error_category's default ctor isn't constexpr. (Should be fixed in vNext.)
# GH-1116 <system_error>: error_category's default ctor isn't constexpr.
diagnostics\syserr\syserr.errcat\syserr.errcat.nonvirtuals\default_ctor.pass.cpp

# STL Bug: future incorrectly uses copy assignment instead of copy construction in set_value. (Should be fixed in vNext.)
# GH-1190 <future>: incorrectly used copy assignment instead of copy construction in set_value
thread\futures\futures.promise\set_value_const.pass.cpp

# STL bug: GH-757 <xstring>: Too many enabled hash specializations
# GH-757 <xstring>: Too many enabled hash specializations
strings\basic.string.hash\char_type_hash.fail.cpp
strings\string.view\string.view.hash\char_type.hash.fail.cpp

# STL bug: GH-784 <type_traits>: aligned_storage has incorrect alignment defaults
# GH-784 <type_traits>: aligned_storage has incorrect alignment defaults
utilities\meta\meta.trans\meta.trans.other\aligned_storage.pass.cpp

# GH-519 <cmath>: signbit() misses overloads for integer types
depr\depr.c.headers\math_h.pass.cpp
numerics\c.math\cmath.pass.cpp


# *** CRT BUGS ***
# We're permanently missing aligned_alloc().
Expand All @@ -634,10 +640,6 @@ thread\thread.semaphore\try_acquire.pass.cpp
thread\thread.barrier\completion.pass.cpp
thread\thread.barrier\max.pass.cpp

# Test bug/LEWG issue or STL bug. See GH-519 "<cmath>: signbit() misses overloads for integer types".
depr\depr.c.headers\math_h.pass.cpp
numerics\c.math\cmath.pass.cpp

# Test bug after LWG-2899 "is_(nothrow_)move_constructible and tuple, optional and unique_ptr" was accepted.
utilities\smartptr\unique.ptr\unique.ptr.class\unique.ptr.asgn\move_convert.pass.cpp
utilities\smartptr\unique.ptr\unique.ptr.class\unique.ptr.asgn\move_convert.runtime.pass.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5049,4 +5049,12 @@ inline constexpr DoublePrecisionToCharsTestCase double_general_precision_to_char
{0x1.88e2d605edc3dp+345, chars_format::general, 3, "1.1e+104"},
{0x1.88e2d605edc3dp+345, chars_format::general, 2, "1.1e+104"},
{0x1.88e2d605edc3dp+345, chars_format::general, 1, "1e+104"},

// More cases that the UCRT had trouble with (e.g. DevCom-1093399).
{0x1.8p+62, chars_format::general, 17, "6.9175290276410819e+18"},
{0x1.0a2742p+17, chars_format::general, 6, "136271"},
{0x1.f8b0f962cdffbp+205, chars_format::general, 14, "1.0137595739223e+62"},
{0x1.f8b0f962cdffbp+205, chars_format::general, 17, "1.0137595739222531e+62"},
{0x1.f8b0f962cdffbp+205, chars_format::general, 51, "1.01375957392225305727423222620636224221808910954041e+62"},
{0x1.f8b0f962cdffbp+205, chars_format::general, 55, "1.013759573922253057274232226206362242218089109540405973e+62"},
};
Loading