Skip to content

Commit 918d2cc

Browse files
cpplearnerCaseyCartertimsong-cpp
authored andcommitted
<ranges>: Temporarily disable join_view for non-forward_ranges, pending resolution of LWG-3698 (microsoft#2727)
Co-authored-by: Casey Carter <[email protected]> Co-authored-by: timsong-cpp <[email protected]>
1 parent 08705f3 commit 918d2cc

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

stl/inc/ranges

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3068,6 +3068,19 @@ namespace ranges {
30683068
requires view<_Vw> && input_range<range_reference_t<_Vw>>
30693069
class join_view : public _Join_view_base<_Vw> {
30703070
// clang-format on
3071+
3072+
#ifndef _USE_JOIN_VIEW_INPUT_RANGE
3073+
static_assert(forward_range<_Vw>,
3074+
"Due to a design flaw, join_view can misbehave "
3075+
"with some input-only ranges (see https://wg21.link/lwg3698). "
3076+
"We believe that WG21 will be unable to fix this problem without breaking ABI. "
3077+
"To minimize breakage when a fix is implemented, "
3078+
"we are temporarily disabling potentially problematic cases. "
3079+
"You can define _USE_JOIN_VIEW_INPUT_RANGE to suppress this diagnostic, "
3080+
"but be aware that you will almost certainly need to recompile "
3081+
"when we release a fix.");
3082+
#endif // _USE_JOIN_VIEW_INPUT_RANGE
3083+
30713084
private:
30723085
template <bool _Const>
30733086
using _InnerRng = range_reference_t<_Maybe_const<_Const, _Vw>>;

tests/libcxx/usual_matrix.lst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
RUNALL_INCLUDE ..\universal_prefix.lst
55
RUNALL_CROSSLIST
66
# TRANSITION, LLVM-53957: _SILENCE_ALL_CXX23_DEPRECATION_WARNINGS belongs to llvm-project/libcxx/test/support/msvc_stdlib_force_include.h
7-
PM_CL="/EHsc /MTd /std:c++latest /permissive- /FImsvc_stdlib_force_include.h /wd4643 /D_STL_CALL_ABORT_INSTEAD_OF_INVALID_PARAMETER /D_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS"
7+
PM_CL="/EHsc /MTd /std:c++latest /permissive- /FImsvc_stdlib_force_include.h /wd4643 /D_STL_CALL_ABORT_INSTEAD_OF_INVALID_PARAMETER /D_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS /D_USE_JOIN_VIEW_INPUT_RANGE"
88
RUNALL_CROSSLIST
99
PM_CL="/analyze:autolog- /Zc:preprocessor"
1010
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing"

tests/std/tests/P0896R4_views_join/test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Microsoft Corporation.
22
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
33

4+
#define _USE_JOIN_VIEW_INPUT_RANGE
5+
46
#include <algorithm>
57
#include <array>
68
#include <cassert>

0 commit comments

Comments
 (0)