Skip to content

Commit

Permalink
Enable variant P0608R3 in C++17, update LLVM, overhaul variant/`a…
Browse files Browse the repository at this point in the history
…ny`/`optional` tests (#4713)
  • Loading branch information
StephanTLavavej authored Jun 18, 2024
1 parent b483591 commit 18c09c4
Show file tree
Hide file tree
Showing 14 changed files with 3,611 additions and 2,151 deletions.
2 changes: 1 addition & 1 deletion docs/cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"type": "git",
"git": {
"repositoryUrl": "https://github.com/llvm/llvm-project.git",
"commitHash": "2e2b6b53f5f63179b52168ee156df7c76b90bc71"
"commitHash": "12fcca0afeb08fbe41d79c5387cfacb249992bb4"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion llvm-project
Submodule llvm-project updated 980 files
7 changes: 0 additions & 7 deletions stl/inc/variant
Original file line number Diff line number Diff line change
Expand Up @@ -862,24 +862,17 @@ using _Variant_destroy_layer = conditional_t<conjunction_v<is_trivially_destruct
#pragma warning(disable : 5215) // '%s' a function parameter with volatile qualified type is deprecated in C++20
#endif // ^^^ not Clang ^^^

#if _HAS_CXX20
// build Ti x[] = {std::forward<T>(t)};
template <size_t _Idx, class _TargetType>
auto _Construct_array(_TargetType (&&)[1]) -> _Meta_list<integral_constant<size_t, _Idx>, _TargetType>;

template <size_t _Idx, class _TargetType, class _InitializerType>
using _Variant_type_resolver = decltype(_STD _Construct_array<_Idx, _TargetType>({_STD declval<_InitializerType>()}));
#endif // _HAS_CXX20

template <size_t _Idx, class _TargetType>
struct _Variant_init_single_overload {
#if _HAS_CXX20
template <class _InitializerType>
auto operator()(_TargetType, _InitializerType&&) -> _Variant_type_resolver<_Idx, _TargetType, _InitializerType>;
#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv
template <class _InitializerType>
auto operator()(_TargetType, _InitializerType&&) -> _Meta_list<integral_constant<size_t, _Idx>, _TargetType>;
#endif // ^^^ !_HAS_CXX20 ^^^
};

template <class _Indices, class... _Types>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/yvals_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
// P0602R4 Propagating Copy/Move Triviality In variant/optional
// P0604R0 invoke_result, is_invocable, is_nothrow_invocable
// P0607R0 Inline Variables For The STL
// P0608R3 Improving variant's Converting Constructor/Assignment
// P0682R1 Repairing Elementary String Conversions
// P0739R0 Improving Class Template Argument Deduction For The STL
// P0858R0 Constexpr Iterator Requirements
Expand Down Expand Up @@ -185,7 +186,6 @@
// P0586R2 Integer Comparison Functions
// P0591R4 Utility Functions For Uses-Allocator Construction
// P0595R2 is_constant_evaluated()
// P0608R3 Improving variant's Converting Constructor/Assignment
// P0616R0 Using move() In <numeric>
// P0631R8 <numbers> Math Constants
// P0645R10 <format> Text Formatting
Expand Down
1 change: 1 addition & 0 deletions tests/std/test.lst
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ tests\P0053R7_cpp_synchronized_buffered_ostream
tests\P0067R5_charconv
tests\P0083R3_splicing_maps_and_sets
tests\P0088R3_variant
tests\P0088R3_variant_msvc
tests\P0092R1_polishing_chrono
tests\P0122R7_span
tests\P0122R7_span_death
Expand Down
54 changes: 1 addition & 53 deletions tests/std/tests/P0088R3_variant/env.lst
Original file line number Diff line number Diff line change
@@ -1,56 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# This is `usual_17_matrix.lst`, with `/DCONSTEXPR_NOTHROW` added to C1XX permissive configurations since the test is
# sensitive to our permissive-mode treatment of calls to potentially-throwing functions as `noexcept` when they are
# constant expressions.

RUNALL_INCLUDE ..\prefix.lst
RUNALL_CROSSLIST
* PM_CL="/w14640 /Zc:threadSafeInit-"
RUNALL_CROSSLIST
PM_CL="/EHsc /MD /D_ITERATOR_DEBUG_LEVEL=0 /std:c++latest /permissive- /Zc:noexceptTypes-"
ASAN PM_CL="/EHsc /MD /std:c++latest /permissive- /Zc:noexceptTypes- -fsanitize=address /Zi" PM_LINK="/debug"
PM_CL="/EHsc /MD /D_ITERATOR_DEBUG_LEVEL=0 /std:c++17 /DCONSTEXPR_NOTHROW /DTEST_PERMISSIVE"
ASAN PM_CL="/EHsc /MD /std:c++17 /DCONSTEXPR_NOTHROW /DTEST_PERMISSIVE -fsanitize=address /Zi" PM_LINK="/debug"
PM_CL="/EHsc /MD /D_ITERATOR_DEBUG_LEVEL=0 /std:c++20"
ASAN PM_CL="/EHsc /MD /std:c++20 -fsanitize=address /Zi" PM_LINK="/debug"
PM_CL="/EHsc /MD /D_ITERATOR_DEBUG_LEVEL=1 /std:c++latest /permissive-"
ASAN PM_CL="/EHsc /MD /std:c++latest /permissive- -fsanitize=address /Zi" PM_LINK="/debug"
PM_CL="/EHsc /MD /D_ITERATOR_DEBUG_LEVEL=0 /std:c++latest /permissive- /Zc:char8_t- /Zc:preprocessor"
ASAN PM_CL="/EHsc /MD /std:c++latest /permissive- /Zc:char8_t- /Zc:preprocessor -fsanitize=address /Zi" PM_LINK="/debug"
PM_CL="/EHsc /MDd /D_ITERATOR_DEBUG_LEVEL=0 /std:c++latest /permissive- /Zc:wchar_t-"
ASAN PM_CL="/EHsc /MDd /std:c++latest /permissive- /Zc:wchar_t- -fsanitize=address /Zi" PM_LINK="/debug"
PM_CL="/EHsc /MDd /D_ITERATOR_DEBUG_LEVEL=1 /std:c++latest /permissive-"
ASAN PM_CL="/EHsc /MDd /std:c++latest /permissive- -fsanitize=address /Zi" PM_LINK="/debug"
PM_CL="/EHsc /MDd /D_ITERATOR_DEBUG_LEVEL=2 /std:c++latest /permissive- /fp:except /Zc:preprocessor"
ASAN PM_CL="/EHsc /MDd /std:c++latest /permissive- /fp:except /Zc:preprocessor -fsanitize=address /Zi" PM_LINK="/debug"
PM_CL="/EHsc /MDd /D_ITERATOR_DEBUG_LEVEL=2 /std:c++17 /permissive-"
ASAN PM_CL="/EHsc /MDd /std:c++17 /permissive- -fsanitize=address /Zi" PM_LINK="/debug"
PM_CL="/EHsc /MDd /D_ITERATOR_DEBUG_LEVEL=2 /std:c++20 /permissive-"
ASAN PM_CL="/EHsc /MDd /std:c++20 /permissive- -fsanitize=address /Zi" PM_LINK="/debug"
PM_CL="/EHsc /MT /D_ITERATOR_DEBUG_LEVEL=0 /std:c++latest /permissive-"
ASAN PM_CL="/EHsc /MT /std:c++latest /permissive- -fsanitize=address /Zi" PM_LINK="/debug"
PM_CL="/EHsc /MT /D_ITERATOR_DEBUG_LEVEL=0 /std:c++latest /permissive- /analyze:only /analyze:autolog-"
ASAN PM_CL="/EHsc /MT /std:c++latest /permissive- /analyze:only /analyze:autolog- -fsanitize=address /Zi" PM_LINK="/debug"
PM_CL="/EHsc /MT /D_ITERATOR_DEBUG_LEVEL=1 /std:c++latest /permissive-"
# No corresponding ASAN config, since the above differs from another config only in IDL
PM_CL="/EHsc /MTd /D_ITERATOR_DEBUG_LEVEL=0 /std:c++latest /permissive- /fp:strict"
ASAN PM_CL="/EHsc /MTd /std:c++latest /permissive- /fp:strict -fsanitize=address /Zi" PM_LINK="/debug"
PM_CL="/EHsc /MTd /D_ITERATOR_DEBUG_LEVEL=1 /std:c++latest /permissive-"
ASAN PM_CL="/EHsc /MTd /std:c++latest /permissive- -fsanitize=address /Zi" PM_LINK="/debug"
PM_CL="/EHsc /MTd /D_ITERATOR_DEBUG_LEVEL=2 /std:c++latest /permissive /DCONSTEXPR_NOTHROW /DTEST_PERMISSIVE"
ASAN PM_CL="/EHsc /MTd /std:c++latest /permissive /DCONSTEXPR_NOTHROW /DTEST_PERMISSIVE -fsanitize=address /Zi" PM_LINK="/debug"
PM_CL="/EHsc /MTd /D_ITERATOR_DEBUG_LEVEL=2 /std:c++latest /permissive- /analyze:only /analyze:autolog-"
ASAN PM_CL="/EHsc /MTd /std:c++latest /permissive- /analyze:only /analyze:autolog- -fsanitize=address /Zi" PM_LINK="/debug"
# With /clr /std:c++20, extreme compiler memory consumption causes test timeouts.
PM_CL="/clr /MD /std:c++17 /DCONSTEXPR_NOTHROW /DTEST_PERMISSIVE"
PM_CL="/clr /MDd /std:c++17 /DCONSTEXPR_NOTHROW /DTEST_PERMISSIVE"
PM_CL="/BE /c /EHsc /MD /std:c++latest /permissive-"
PM_CL="/BE /c /EHsc /MDd /std:c++17 /permissive-"
PM_CL="/BE /c /EHsc /MT /std:c++20 /permissive-"
PM_CL="/BE /c /EHsc /MTd /std:c++latest /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MD /std:c++latest /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MDd /std:c++17 /DTEST_PERMISSIVE"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++20 /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MTd /std:c++latest /permissive- /fp:strict"
RUNALL_INCLUDE ..\usual_17_matrix.lst
Loading

0 comments on commit 18c09c4

Please sign in to comment.