Skip to content
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
15 changes: 8 additions & 7 deletions stl/inc/chrono
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@

#ifdef __cpp_lib_concepts
#include <concepts>
#endif // defined(__cpp_lib_concepts)

#ifdef __cpp_lib_format
#include <format>
#include <iomanip>
#endif // defined(__cpp_lib_concepts)
#endif // defined(__cpp_lib_format)
#endif // _HAS_CXX20

#pragma pack(push, _CRT_PACKING)
Expand Down Expand Up @@ -2274,7 +2277,7 @@ namespace chrono {
: runtime_error(_Make_string(_Tp, _Info)) {}

private:
#ifdef __cpp_lib_concepts
#ifdef __cpp_lib_format
template <class _Duration>
_NODISCARD static string _Make_string(const local_time<_Duration>& _Tp, const local_info& _Info);
#else // ^^^ no workaround / workaround vvv
Expand All @@ -2293,7 +2296,7 @@ namespace chrono {
: runtime_error(_Make_string(_Tp, _Info)) {}

private:
#ifdef __cpp_lib_concepts
#ifdef __cpp_lib_format
template <class _Duration>
_NODISCARD static string _Make_string(const local_time<_Duration>& _Tp, const local_info& _Info);
#else // ^^^ no workaround / workaround vvv
Expand Down Expand Up @@ -5220,8 +5223,7 @@ namespace chrono {
#endif // _HAS_CXX20
} // namespace chrono

#if _HAS_CXX20
#ifdef __cpp_lib_concepts
#ifdef __cpp_lib_format
// [time.format]

template <class _CharT>
Expand Down Expand Up @@ -6518,8 +6520,7 @@ namespace chrono {
}
} // namespace chrono

#endif // __cpp_lib_concepts
#endif // _HAS_CXX20
#endif // __cpp_lib_format

// HELPERS
template <class _Rep, class _Period>
Expand Down
9 changes: 5 additions & 4 deletions stl/inc/format
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@
#define _FORMAT_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#ifndef __cpp_lib_concepts
#pragma message("The contents of <format> are available only with C++20 concepts support.")
#else // ^^^ !defined(__cpp_lib_concepts) / defined(__cpp_lib_concepts) vvv
#ifndef __cpp_lib_format
#pragma message("The contents of <format> are available only in c++latest mode with concepts support;")
#pragma message("see https://github.com/microsoft/STL/issues/1814 for details.")
#else // ^^^ !defined(__cpp_lib_format) / defined(__cpp_lib_format) vvv

#include <array>
#include <charconv>
Expand Down Expand Up @@ -3054,6 +3055,6 @@ _STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)

#endif // __cpp_lib_concepts
#endif // __cpp_lib_format
#endif // _STL_COMPILER_PREPROCESSOR
#endif // _FORMAT_
9 changes: 5 additions & 4 deletions stl/inc/ranges
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
#define _RANGES_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#ifndef __cpp_lib_concepts
#pragma message("The contents of <ranges> are available only with C++20 concepts support.")
#else // ^^^ !defined(__cpp_lib_concepts) / defined(__cpp_lib_concepts) vvv
#ifndef __cpp_lib_ranges
#pragma message("The contents of <ranges> are available only in c++latest mode with concepts support;")
#pragma message("see https://github.com/microsoft/STL/issues/1814 for details.")
#else // ^^^ !defined(__cpp_lib_ranges) / defined(__cpp_lib_ranges) vvv
#include <iosfwd>
#include <iterator>
#include <limits>
Expand Down Expand Up @@ -4116,6 +4117,6 @@ _STD_END
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)
#endif // __cpp_lib_concepts
#endif // __cpp_lib_ranges
#endif // _STL_COMPILER_PREPROCESSOR
#endif // _RANGES_
6 changes: 6 additions & 0 deletions stl/inc/xutility
Original file line number Diff line number Diff line change
Expand Up @@ -2856,10 +2856,12 @@ namespace ranges {
template <class _Ty>
inline constexpr bool enable_view = derived_from<_Ty, view_base>;

#ifdef __cpp_lib_ranges // TRANSITION, GH-1814
// clang-format off
// CONCEPT ranges::view
template <class _Ty>
concept view = range<_Ty> && movable<_Ty> && default_initializable<_Ty> && enable_view<_Ty>;
#endif // TRANSITION, GH-1814

// CONCEPT ranges::output_range
template <class _Rng, class _Ty>
Expand Down Expand Up @@ -3211,16 +3213,20 @@ namespace ranges {
_NODISCARD constexpr _Derived& _Cast() noexcept {
static_assert(derived_from<_Derived, view_interface>,
"view_interface's template argument D must derive from view_interface<D> (N4849 [view.interface]/2).");
#ifdef __cpp_lib_ranges // TRANSITION, GH-1814
static_assert(view<_Derived>,
"view_interface's template argument must model the view concept (N4849 [view.interface]/2).");
#endif // TRANSITION, GH-1814
return static_cast<_Derived&>(*this);
}

_NODISCARD constexpr const _Derived& _Cast() const noexcept {
static_assert(derived_from<_Derived, view_interface>,
"view_interface's template argument D must derive from view_interface<D> (N4849 [view.interface]/2).");
#ifdef __cpp_lib_ranges // TRANSITION, GH-1814
static_assert(view<_Derived>,
"view_interface's template argument must model the view concept (N4849 [view.interface]/2).");
#endif // TRANSITION, GH-1814
return static_cast<const _Derived&>(*this);
}

Expand Down
22 changes: 18 additions & 4 deletions stl/inc/yvals_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,20 @@
// * unique_copy

#include <vcruntime.h>

// TRANSITION, <vcruntime.h> should define _HAS_CXX23
#ifndef _HAS_CXX23
#if _HAS_CXX20 && (defined(_MSVC_LANG) && _MSVC_LANG > 202002L || defined(__cplusplus) && __cplusplus > 202002L)
#define _HAS_CXX23 1
#else
#define _HAS_CXX23 0
#endif
#endif // _HAS_CXX23

#if _HAS_CXX23 && !_HAS_CXX20
#error _HAS_CXX23 must imply _HAS_CXX20.
#endif

#include <xkeycheck.h> // The _HAS_CXX tags must be defined before including this.

#ifndef _STL_WARNING_LEVEL
Expand Down Expand Up @@ -1231,9 +1245,9 @@
#define __cpp_lib_endian 201907L
#define __cpp_lib_erase_if 202002L

#ifdef __cpp_lib_concepts // TRANSITION, GH-395
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395 and GH-1814
#define __cpp_lib_format 201907L
#endif // __cpp_lib_concepts
#endif // _HAS_CXX23 && defined(__cpp_lib_concepts)

#define __cpp_lib_generic_unordered_lookup 201811L
#define __cpp_lib_int_pow2 202002L
Expand Down Expand Up @@ -1261,9 +1275,9 @@
#define __cpp_lib_math_constants 201907L
#define __cpp_lib_polymorphic_allocator 201902L

#ifdef __cpp_lib_concepts // TRANSITION, GH-395
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395 and GH-1814
#define __cpp_lib_ranges 201911L
#endif // __cpp_lib_concepts
#endif // _HAS_CXX23 && defined(__cpp_lib_concepts)

#define __cpp_lib_remove_cvref 201711L
#define __cpp_lib_semaphore 201907L
Expand Down
2 changes: 1 addition & 1 deletion tests/libcxx/usual_matrix.lst
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ RUNALL_CROSSLIST
PM_CL="/EHsc /MTd /std:c++latest /permissive- /FImsvc_stdlib_force_include.h /wd4643"
RUNALL_CROSSLIST
PM_CL="/analyze:autolog- /Zc:preprocessor"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing /D_HAS_CXX23"
2 changes: 1 addition & 1 deletion tests/std/include/range_algorithm_support.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#pragma once

#include <cassert>
#include <concepts>
#include <cstddef>
#include <functional>
#include <iterator>
#include <ranges>
#include <span>
#include <type_traits>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
2 changes: 1 addition & 1 deletion tests/std/tests/P0019R8_atomic_ref/env.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
6 changes: 5 additions & 1 deletion tests/std/tests/P0088R3_variant/env.lst
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ PM_CL="/w14640 /Zc:threadSafeInit-"
RUNALL_CROSSLIST
PM_CL="/EHsc /MD /D_ITERATOR_DEBUG_LEVEL=0 /std:c++latest /permissive- /Zc:noexceptTypes-"
PM_CL="/EHsc /MD /D_ITERATOR_DEBUG_LEVEL=0 /std:c++17 /DCONSTEXPR_NOTHROW /DTEST_PERMISSIVE"
PM_CL="/EHsc /MD /D_ITERATOR_DEBUG_LEVEL=0 /std:c++20 /permissive-"
PM_CL="/EHsc /MD /D_ITERATOR_DEBUG_LEVEL=1 /std:c++latest /permissive-"
PM_CL="/EHsc /MD /D_ITERATOR_DEBUG_LEVEL=0 /std:c++latest /permissive- /Zc:char8_t- /Zc:preprocessor"
PM_CL="/EHsc /MDd /D_ITERATOR_DEBUG_LEVEL=0 /std:c++latest /permissive- /Zc:wchar_t-"
PM_CL="/EHsc /MDd /D_ITERATOR_DEBUG_LEVEL=1 /std:c++latest /permissive-"
PM_CL="/EHsc /MDd /D_ITERATOR_DEBUG_LEVEL=2 /std:c++latest /permissive- /fp:except /Zc:preprocessor"
PM_CL="/EHsc /MDd /D_ITERATOR_DEBUG_LEVEL=2 /std:c++17 /permissive-"
PM_CL="/EHsc /MDd /D_ITERATOR_DEBUG_LEVEL=2 /std:c++20 /permissive-"
PM_CL="/EHsc /MT /D_ITERATOR_DEBUG_LEVEL=0 /std:c++latest /permissive-"
PM_CL="/EHsc /MT /D_ITERATOR_DEBUG_LEVEL=0 /std:c++latest /permissive- /analyze:only /analyze:autolog-"
PM_CL="/EHsc /MT /D_ITERATOR_DEBUG_LEVEL=1 /std:c++latest /permissive-"
Expand All @@ -30,7 +32,9 @@ 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 /EHsc /MD /std:c++latest /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing /EHsc /MDd /std:c++17 /DTEST_PERMISSIVE"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing /EHsc /MTd /std:c++latest /permissive- /fp:strict"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing /EHsc /MT /std:c++latest"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing /EHsc /MTd /std:c++latest /permissive- /D_HAS_CXX23 /fp:strict"
2 changes: 1 addition & 1 deletion tests/std/tests/P0122R7_span/env.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
2 changes: 1 addition & 1 deletion tests/std/tests/P0122R7_span_death/env.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_winsdk_matrix.lst
RUNALL_INCLUDE ..\usual_20_winsdk_matrix.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
2 changes: 1 addition & 1 deletion tests/std/tests/P0325R4_to_array/env.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
2 changes: 1 addition & 1 deletion tests/std/tests/P0339R6_polymorphic_allocator/env.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\concepts_matrix.lst
RUNALL_INCLUDE ..\concepts_latest_matrix.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
2 changes: 1 addition & 1 deletion tests/std/tests/P0356R5_bind_front/env.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_winsdk_matrix.lst
RUNALL_INCLUDE ..\usual_20_winsdk_matrix.lst
2 changes: 1 addition & 1 deletion tests/std/tests/P0415R1_constexpr_complex/env.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
2 changes: 1 addition & 1 deletion tests/std/tests/P0476R2_bit_cast/env.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
2 changes: 1 addition & 1 deletion tests/std/tests/P0528R3_cmpxchg_pad/env.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
2 changes: 1 addition & 1 deletion tests/std/tests/P0586R2_integer_comparison/env.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
2 changes: 1 addition & 1 deletion tests/std/tests/P0595R2_is_constant_evaluated/env.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

RUNALL_INCLUDE ..\usual_latest_matrix.lst
RUNALL_INCLUDE ..\usual_20_matrix.lst
Loading