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

Enable variant P0608R3 in C++17, update LLVM, overhaul variant/any/optional tests #4713

Merged
merged 30 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4d8e263
Unconditionally implement P0608R3 Improving variant's Converting Cons…
StephanTLavavej May 31, 2024
2cbbbb2
llvm-project Micro-Update.
StephanTLavavej Jun 3, 2024
fb6dba1
cgmanifest.json: Update llvm-project commitHash.
StephanTLavavej May 31, 2024
07769cc
transform_llvm.sh: Extract script.
StephanTLavavej May 31, 2024
ff3b3f3
P0088R3_variant: Replace LLVM SOURCES with script output, no manual c…
StephanTLavavej May 31, 2024
3322f70
P0088R3_variant: Add namespaces, update run_test() calls.
StephanTLavavej May 31, 2024
91e5db4
P0088R3_variant: Handle std::hash, std::get specializations.
StephanTLavavej May 31, 2024
b3983d1
P0088R3_variant: Restore EDG and /clr workarounds.
StephanTLavavej May 31, 2024
393669f
P0088R3_variant: Add MSVC workaround, also affects EDG (not yet repor…
StephanTLavavej May 31, 2024
1762e86
P0088R3_variant: Add Clang workarounds, not yet investigated.
StephanTLavavej May 31, 2024
e0a056d
P0088R3_variant: Guard relops::three_way, visit::return_type with `_H…
StephanTLavavej May 31, 2024
1cb5798
P0088R3_variant: Guard P2637R3 Member visit.
StephanTLavavej May 31, 2024
db903ed
P0088R3_variant: Use usual_17_matrix.lst and is_permissive.
StephanTLavavej Jun 1, 2024
dbbd671
P0088R3_variant: Update instructions to record what we did.
StephanTLavavej May 31, 2024
5c8af5e
P0220R1_any: Cleanup instructions to reduce unnecessary divergence.
StephanTLavavej May 31, 2024
099bf0d
P0220R1_any: Replace LLVM SOURCES with script output, no manual chang…
StephanTLavavej Jun 2, 2024
20cdcde
P0220R1_any: Restore namespaces, update run_test() calls.
StephanTLavavej Jun 2, 2024
3e3b9f0
P0220R1_any: Silence warning C4640: construction of local static obje…
StephanTLavavej Jun 2, 2024
ea249f1
P0220R1_optional: Replace LLVM SOURCES with script output, no manual …
StephanTLavavej Jun 2, 2024
5e66fd7
P0220R1_optional: Add namespaces, update run_test() calls.
StephanTLavavej Jun 2, 2024
0ccc024
P0220R1_optional: Handle std::hash specialization.
StephanTLavavej Jun 2, 2024
e1e4bdb
P0220R1_optional: Restore EDG workarounds.
StephanTLavavej Jun 2, 2024
150f518
P0220R1_optional: Add/restore `_HAS_CXX20`/`_HAS_CXX23` guards.
StephanTLavavej Jun 2, 2024
7674011
P0220R1_optional: Update instructions to record what we did.
StephanTLavavej Jun 2, 2024
d280720
Drop unnecessary deprecation/removal escape hatches.
StephanTLavavej Jun 1, 2024
0663bdc
P0088R3_variant_msvc: Extract, part 1. Pure movement, no changes.
StephanTLavavej Jun 3, 2024
6a66454
P0088R3_variant_msvc: Extract, part 2. Transfer `<msvc_stdlib_force_i…
StephanTLavavej Jun 3, 2024
bc6e305
transform_llvm.sh: CRLF.
StephanTLavavej Jun 4, 2024
344ad18
P0088R3_variant: Avoid long line.
StephanTLavavej Jun 4, 2024
0f27f3d
P0220R1_any: Work around VSO-1664382 (/clr constinit).
StephanTLavavej Jun 5, 2024
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 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