| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[libc++] Make sure ranges algorithms and views handle boolean-testable correctly (#69378) Before this patch, we would fail to implicitly convert the result of predicates to bool, which means we'd potentially perform a copy or move construction of the boolean-testable, which isn't allowed. The same holds true for comparing iterators against sentinels, which is allowed to return a boolean-testable type. We already had tests aiming to ensure correct handling of these types, but they failed to provide appropriate coverage in several cases due to guaranteed RVO. This patch fixes the tests, adds tests for missing algorithms and views, and fixes the actual problems in the code. Fixes #69074 | 2 年前 | |
[libc++][pstl] Improve exception handling (#88998) There were various places where we incorrectly handled exceptions in the PSTL. Typical issues were missing noexcept and taking iterators by value instead of by reference. This patch fixes those inconsistent and incorrect instances, and adds proper tests for all of those. Note that the previous tests were often incorrectly turned into no-ops by the compiler due to copy ellision, which doesn't happen with these new tests. | 2 年前 | |
[libc++][pstl] Improve exception handling (#88998) There were various places where we incorrectly handled exceptions in the PSTL. Typical issues were missing noexcept and taking iterators by value instead of by reference. This patch fixes those inconsistent and incorrect instances, and adds proper tests for all of those. Note that the previous tests were often incorrectly turned into no-ops by the compiler due to copy ellision, which doesn't happen with these new tests. | 2 年前 | |
[libc++] [test] Fix portability issues for MSVC (#93259) * Guard std::__make_from_tuple_impl tests with #ifdef _LIBCPP_VERSION and LIBCPP_STATIC_ASSERT. * Change _LIBCPP_CONSTEXPR_SINCE_CXX20 to TEST_CONSTEXPR_CXX20. + Other functions in variant.swap/swap.pass.cpp were already using the proper test macro. * Mark what as [[maybe_unused]] when used by TEST_LIBCPP_REQUIRE. + This updates one occurrence in libcxx/test/libcxx for consistency. * Windows _putenv_s() takes 2 arguments, not 3. + See MSVC documentation: https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/putenv-s-wputenv-s?view=msvc-170 + POSIX setenv() takes int overwrite, but Windows _putenv_s() always overwrites. * Avoid non-Standard zero-length arrays. + Followup to #74183 and #79792. * Add operator++() to unsized_it. + The Standard requires this due to [N4981][] [move.iter.requirements]/1 "The template parameter Iterator shall either meet the *Cpp17InputIterator* requirements ([input.iterators]) or model input_iterator ([iterator.concept.input])." + MSVC's STL requires this because it has a strengthened exception specification in move_iterator that inspects the underlying iterator's increment operator. * uniform_int_distribution forbids int8_t/uint8_t. + See [N4981][] [rand.req.genl]/1.5. MSVC's STL enforces this. + Note that when changing the distribution's IntType, we need to be careful to preserve the original value range of [0, max_input]. * fstreams are constructible from const fs::path::value_type* on wide systems. + See [ifstream.cons], [ofstream.cons], [fstream.cons]. * In msvc_stdlib_force_include.h, map _HAS_CXX23 to TEST_STD_VER 23 instead of 99. + On 2023-05-23, https://github.com/llvm/llvm-project/commit/71400505ca048507e827013eb1ea0bc863525cab started recognizing 23 as a distinct value. * Fix test name typo: destory_elements.pass.cpp => destroy_elements.pass.cpp [N4981]: https://wg21.link/N4981 | 2 年前 | |
[libc++] Optimize ranges::fill{,_n} for vector<bool>::iterator (#84642) ------------------------------------------------------ Benchmark old new ------------------------------------------------------ bm_ranges_fill_n/1 1.64 ns 3.06 ns bm_ranges_fill_n/2 3.45 ns 3.06 ns bm_ranges_fill_n/3 4.88 ns 3.06 ns bm_ranges_fill_n/4 6.46 ns 3.06 ns bm_ranges_fill_n/5 8.03 ns 3.06 ns bm_ranges_fill_n/6 9.65 ns 3.07 ns bm_ranges_fill_n/7 11.5 ns 3.06 ns bm_ranges_fill_n/8 13.0 ns 3.06 ns bm_ranges_fill_n/16 25.9 ns 3.06 ns bm_ranges_fill_n/64 103 ns 4.62 ns bm_ranges_fill_n/512 711 ns 4.40 ns bm_ranges_fill_n/4096 5642 ns 9.86 ns bm_ranges_fill_n/32768 45135 ns 33.6 ns bm_ranges_fill_n/262144 360818 ns 243 ns bm_ranges_fill_n/1048576 1442828 ns 982 ns bm_ranges_fill/1 1.63 ns 3.17 ns bm_ranges_fill/2 3.43 ns 3.28 ns bm_ranges_fill/3 4.97 ns 3.31 ns bm_ranges_fill/4 6.53 ns 3.27 ns bm_ranges_fill/5 8.12 ns 3.33 ns bm_ranges_fill/6 9.76 ns 3.32 ns bm_ranges_fill/7 11.6 ns 3.29 ns bm_ranges_fill/8 13.2 ns 3.26 ns bm_ranges_fill/16 26.3 ns 3.26 ns bm_ranges_fill/64 104 ns 4.92 ns bm_ranges_fill/512 716 ns 4.47 ns bm_ranges_fill/4096 5772 ns 8.21 ns bm_ranges_fill/32768 45778 ns 33.1 ns bm_ranges_fill/262144 351422 ns 241 ns bm_ranges_fill/1048576 1404710 ns 965 ns | 2 年前 | |
[libc++][test] Avoid non-Standard zero-length arrays (#74183) Found while running libc++'s test suite with MSVC's STL, where we use both MSVC's compiler and Clang/LLVM. MSVC's compiler rejects the non-Standard extension of zero-length arrays. For conformance, I'm changing these occurrences to std::array<int, 0>. Many of these files already had #include <array>; I'm adding it to the rest. I wanted to add -Wzero-length-array to libcxx/utils/libcxx/test/params.py to prevent future occurrences, but it complained about product code :crying_cat_face: : In file included from /home/runner/_work/llvm-project/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long.pass.cpp:18: In file included from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/istream:170: In file included from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/ostream:172: In file included from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__system_error/error_code.h:18: In file included from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__system_error/error_category.h:15: /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/string:811:25: error: zero size arrays are an extension [-Werror,-Wzero-length-array] 811 | char __padding_[sizeof(value_type) - 1]; | ^~~~~~~~~~~~~~~~~~~~~~ /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/string:817:19: note: in instantiation of member class 'std::basic_string<char>::__short' requested here 817 | static_assert(sizeof(__short) == (sizeof(value_type) * (__min_cap + 1)), "__short has an unexpected size."); | ^ /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/string:2069:5: note: in instantiation of template class 'std::basic_string<char>' requested here 2069 | _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_DECLARE, char) | ^ /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__string/extern_template_lists.h:31:60: note: expanded from macro '_LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST' 31 | _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*, size_type)) \ | ^ I pushed a tiny commit to fix unrelated comment typos, in an attempt to clear out spurious CI failures. | 2 年前 | |
[libc++][pstl] Improve exception handling (#88998) There were various places where we incorrectly handled exceptions in the PSTL. Typical issues were missing noexcept and taking iterators by value instead of by reference. This patch fixes those inconsistent and incorrect instances, and adds proper tests for all of those. Note that the previous tests were often incorrectly turned into no-ops by the compiler due to copy ellision, which doesn't happen with these new tests. | 2 年前 | |
[libc++][test] Avoid non-Standard zero-length arrays (#74183) Found while running libc++'s test suite with MSVC's STL, where we use both MSVC's compiler and Clang/LLVM. MSVC's compiler rejects the non-Standard extension of zero-length arrays. For conformance, I'm changing these occurrences to std::array<int, 0>. Many of these files already had #include <array>; I'm adding it to the rest. I wanted to add -Wzero-length-array to libcxx/utils/libcxx/test/params.py to prevent future occurrences, but it complained about product code :crying_cat_face: : In file included from /home/runner/_work/llvm-project/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long.pass.cpp:18: In file included from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/istream:170: In file included from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/ostream:172: In file included from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__system_error/error_code.h:18: In file included from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__system_error/error_category.h:15: /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/string:811:25: error: zero size arrays are an extension [-Werror,-Wzero-length-array] 811 | char __padding_[sizeof(value_type) - 1]; | ^~~~~~~~~~~~~~~~~~~~~~ /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/string:817:19: note: in instantiation of member class 'std::basic_string<char>::__short' requested here 817 | static_assert(sizeof(__short) == (sizeof(value_type) * (__min_cap + 1)), "__short has an unexpected size."); | ^ /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/string:2069:5: note: in instantiation of template class 'std::basic_string<char>' requested here 2069 | _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_DECLARE, char) | ^ /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__string/extern_template_lists.h:31:60: note: expanded from macro '_LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST' 31 | _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*, size_type)) \ | ^ I pushed a tiny commit to fix unrelated comment typos, in an attempt to clear out spurious CI failures. | 2 年前 | |
[libc++] Make sure ranges algorithms and views handle boolean-testable correctly (#69378) Before this patch, we would fail to implicitly convert the result of predicates to bool, which means we'd potentially perform a copy or move construction of the boolean-testable, which isn't allowed. The same holds true for comparing iterators against sentinels, which is allowed to return a boolean-testable type. We already had tests aiming to ensure correct handling of these types, but they failed to provide appropriate coverage in several cases due to guaranteed RVO. This patch fixes the tests, adds tests for missing algorithms and views, and fixes the actual problems in the code. Fixes #69074 | 2 年前 | |
[libc++][ranges] P1223R5: find_last (#99312) Implements [P1223R5][] completely. Includes an implementation of find_last, find_last_if, and find_last_if_not. [P1223R5]: https://wg21.link/p1223r5 | 2 年前 | |
[libc++][pstl] Improve exception handling (#88998) There were various places where we incorrectly handled exceptions in the PSTL. Typical issues were missing noexcept and taking iterators by value instead of by reference. This patch fixes those inconsistent and incorrect instances, and adds proper tests for all of those. Note that the previous tests were often incorrectly turned into no-ops by the compiler due to copy ellision, which doesn't happen with these new tests. | 2 年前 | |
| 2 年前 | ||
[libc++][pstl] Improve exception handling (#88998) There were various places where we incorrectly handled exceptions in the PSTL. Typical issues were missing noexcept and taking iterators by value instead of by reference. This patch fixes those inconsistent and incorrect instances, and adds proper tests for all of those. Note that the previous tests were often incorrectly turned into no-ops by the compiler due to copy ellision, which doesn't happen with these new tests. | 2 年前 | |
[libc++] Make <ranges> non-experimental When we ship LLVM 16, <ranges> won't be considered experimental anymore. We might as well do this sooner rather than later. Differential Revision: https://reviews.llvm.org/D132151 | 3 年前 | |
[libc++][pstl] Improve exception handling (#88998) There were various places where we incorrectly handled exceptions in the PSTL. Typical issues were missing noexcept and taking iterators by value instead of by reference. This patch fixes those inconsistent and incorrect instances, and adds proper tests for all of those. Note that the previous tests were often incorrectly turned into no-ops by the compiler due to copy ellision, which doesn't happen with these new tests. | 2 年前 | |
[libc++][test] Avoid non-Standard zero-length arrays (#74183) Found while running libc++'s test suite with MSVC's STL, where we use both MSVC's compiler and Clang/LLVM. MSVC's compiler rejects the non-Standard extension of zero-length arrays. For conformance, I'm changing these occurrences to std::array<int, 0>. Many of these files already had #include <array>; I'm adding it to the rest. I wanted to add -Wzero-length-array to libcxx/utils/libcxx/test/params.py to prevent future occurrences, but it complained about product code :crying_cat_face: : In file included from /home/runner/_work/llvm-project/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long.pass.cpp:18: In file included from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/istream:170: In file included from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/ostream:172: In file included from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__system_error/error_code.h:18: In file included from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__system_error/error_category.h:15: /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/string:811:25: error: zero size arrays are an extension [-Werror,-Wzero-length-array] 811 | char __padding_[sizeof(value_type) - 1]; | ^~~~~~~~~~~~~~~~~~~~~~ /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/string:817:19: note: in instantiation of member class 'std::basic_string<char>::__short' requested here 817 | static_assert(sizeof(__short) == (sizeof(value_type) * (__min_cap + 1)), "__short has an unexpected size."); | ^ /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/string:2069:5: note: in instantiation of template class 'std::basic_string<char>' requested here 2069 | _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_DECLARE, char) | ^ /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__string/extern_template_lists.h:31:60: note: expanded from macro '_LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST' 31 | _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*, size_type)) \ | ^ I pushed a tiny commit to fix unrelated comment typos, in an attempt to clear out spurious CI failures. | 2 年前 | |
[libc++][test] Avoid non-Standard zero-length arrays (#74183) Found while running libc++'s test suite with MSVC's STL, where we use both MSVC's compiler and Clang/LLVM. MSVC's compiler rejects the non-Standard extension of zero-length arrays. For conformance, I'm changing these occurrences to std::array<int, 0>. Many of these files already had #include <array>; I'm adding it to the rest. I wanted to add -Wzero-length-array to libcxx/utils/libcxx/test/params.py to prevent future occurrences, but it complained about product code :crying_cat_face: : In file included from /home/runner/_work/llvm-project/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long.pass.cpp:18: In file included from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/istream:170: In file included from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/ostream:172: In file included from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__system_error/error_code.h:18: In file included from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__system_error/error_category.h:15: /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/string:811:25: error: zero size arrays are an extension [-Werror,-Wzero-length-array] 811 | char __padding_[sizeof(value_type) - 1]; | ^~~~~~~~~~~~~~~~~~~~~~ /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/string:817:19: note: in instantiation of member class 'std::basic_string<char>::__short' requested here 817 | static_assert(sizeof(__short) == (sizeof(value_type) * (__min_cap + 1)), "__short has an unexpected size."); | ^ /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/string:2069:5: note: in instantiation of template class 'std::basic_string<char>' requested here 2069 | _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_DECLARE, char) | ^ /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__string/extern_template_lists.h:31:60: note: expanded from macro '_LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST' 31 | _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*, size_type)) \ | ^ I pushed a tiny commit to fix unrelated comment typos, in an attempt to clear out spurious CI failures. | 2 年前 | |
[libc++] Vectorize std::mismatch with trivially equality comparable types (#87716) | 2 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 |