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 __cpp_lib_concepts for EDG, part 1 #4296

Merged
merged 39 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
72de60e
Make `ranges::construct_at` call `std::construct_at` on EDG
cpplearner Oct 9, 2023
75fd274
VSO-1161828 DevCom-10156297 EDGcpfe/23297 REPORTED: EDG: wrong preced…
cpplearner Jan 3, 2024
94b23b8
VSO-1898880 EDGcpfe/26641 EDG fails to handle variable template speci…
cpplearner Jan 3, 2024
ae5116f
VSO-1898890 EDGcpfe/26576 EDG produces an error for conversion from a…
cpplearner Jan 3, 2024
22b1235
VSO-1898912 EDGcpfe/26535 EDG does not consider single_view<trivially…
cpplearner Jan 3, 2024
d1d6942
VSO-1898913 EDGcpfe/26534 Befriending an abbreviated function templat…
cpplearner Jan 3, 2024
d27b9be
VSO-1898915 EDGcpfe/23896 EDG produces a hard error for can_three_way…
cpplearner Jan 3, 2024
ee2f18b
VSO-1898929 EDGcpfe/25761 EDG rejects requires-clause in a definition…
cpplearner Jan 3, 2024
0f4a9a0
VSO-1898933 EDGcpfe/26745 EDG rejects parenthesized aggregate initial…
cpplearner Jan 3, 2024
70ecbd1
VSO-1898937 EDGcpfe/23985 EDG's __is_convertible_to depends on whethe…
cpplearner Jan 3, 2024
a269667
VSO-1898939 EDGcpfe/26746 EDG's __is_constructible has wrong value
cpplearner Jan 3, 2024
eb3f1b9
VSO-1898941 EDGcpfe/23985 EDG's default_initializable<const T> has wr…
cpplearner Jan 3, 2024
7067fd1
VSO-1898945 EDGcpfe/23985 EDG's default_initializable<AggregatesExpli…
cpplearner Jan 3, 2024
0564fb7
VSO-1898947 EDGcpfe/26747 EDG's std::nullptr_t has relational operato…
cpplearner Jan 3, 2024
6959375
VSO-1898962 EDGcpfe/26750 EDG constexpr dynamic allocations can't han…
cpplearner Jan 3, 2024
894549c
VSO-1900279 EDGcpfe/26763 EDG: Conditional explicit specifier is chec…
cpplearner Jan 3, 2024
de175b6
VSO-1900281 EDGcpfe/26539 EDG: Variable template is instantiated too …
cpplearner Jan 3, 2024
350387a
VSO-1900290 EDGcpfe/25760 EDG thinks a member does not exist in condi…
cpplearner Jan 3, 2024
082225b
VSO-1900293 EDGcpfe/26577 EDG rejects constrained alias template in a…
cpplearner Jan 3, 2024
743e9fa
VSO-1901430 EDGcpfe/26547 EDG rejects as_const_view with error: atomi…
cpplearner Jan 3, 2024
8753c4c
P0896R4_views_join: EDG ICE with constant-evaluating std::string in d…
cpplearner Jan 3, 2024
b4afb3a
P2322R6_ranges_alg_fold: EDG rejects constant-evaluating vector in de…
cpplearner Jan 3, 2024
ed64238
Make __cpp_lib_concepts not depend on __EDG__
cpplearner Jan 3, 2024
c2f695c
Uncomment `/BE` tests
cpplearner Jan 4, 2024
32f4220
Fix P0898R3_concepts
cpplearner Jan 4, 2024
70c6c8e
VSO-1900291 EDGcpfe/26751 EDG ICE involving pointer arithmetic
cpplearner Jan 5, 2024
07c08df
<ranges>: EDG mishandles a requires-clause that involves a local type…
cpplearner Jan 5, 2024
bc7e59d
Skip parts of ranges tests that seem to make EDG run forever
cpplearner Jan 5, 2024
65cfb73
VSO-1900294 EDGcpfe/26749 EDG: Constrained default constructor causes…
cpplearner Jan 6, 2024
9e9d1ee
Remove `(Clang)` and `(EDG)` from comments
cpplearner Jan 6, 2024
8bdc2c3
Merge branch 'main' into edg-concepts-1
cpplearner Jan 13, 2024
1ec9af8
Report EDG bug VSO-1948896
CaseyCarter Jan 30, 2024
688025a
Report EDG bug VSO-1949414
CaseyCarter Jan 31, 2024
f12c63a
Merge branch 'main' into edg-concepts-1
StephanTLavavej Jan 31, 2024
a8b9271
Work around VSO-1949451 "EDG concepts rejects std::expected trying to…
StephanTLavavej Jan 31, 2024
6b4e30b
Attempt to avoid timeouts in P0896R4_ranges_alg_find_end.
StephanTLavavej Feb 1, 2024
0409b66
Drop "assert bug so we'll notice when it's fixed".
StephanTLavavej Feb 1, 2024
1b4673f
Properly detect MSVC, part 1.
StephanTLavavej Feb 1, 2024
5850a46
Properly detect MSVC, part 2.
StephanTLavavej Feb 1, 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
4 changes: 4 additions & 0 deletions stl/inc/memory
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,11 @@ namespace ranges {
noexcept(noexcept(::new (static_cast<void*>(_Location))
_Ty(_STD forward<_Types>(_Args)...))) /* strengthened */ {
// clang-format on
#ifdef __EDG__
StephanTLavavej marked this conversation as resolved.
Show resolved Hide resolved
return _STD construct_at(_Location, _STD forward<_Types>(_Args)...);
#else // ^^^ EDG / Other vvv
_MSVC_CONSTEXPR return ::new (static_cast<void*>(_Location)) _Ty(_STD forward<_Types>(_Args)...);
#endif // ^^^ Other ^^^
}
};

Expand Down
10 changes: 9 additions & 1 deletion stl/inc/ranges
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,17 @@ namespace ranges {
template <sized_range _Ty>
inline constexpr auto _Compile_time_max_size<_Ty> = (numeric_limits<range_size_t<_Ty>>::max)();

#ifdef __EDG__ // TRANSITION, VSO-1898880
template <class _Ty>
concept _Constant_sized_range = sized_range<_Ty> && requires { typename _Require_constant<_Ty::size()>; };

template <_Constant_sized_range _Ty>
inline constexpr auto _Compile_time_max_size<_Ty> = _Ty::size();
#else // ^^^ workaround / no workaround vvv
template <sized_range _Ty>
requires requires { typename _Require_constant<_Ty::size()>; }
inline constexpr auto _Compile_time_max_size<_Ty> = _Ty::size();
#endif // ^^^ no workaround ^^^

template <class _Ty, size_t _Size>
inline constexpr auto _Compile_time_max_size<_Ty[_Size]> = _Size;
Expand Down Expand Up @@ -9768,7 +9776,7 @@ namespace ranges {
template <class _Rng>
_NODISCARD consteval int _Cartesian_product_max_size_bit_width() {
using _Size_type = decltype(_Compile_time_max_size<_Rng>);
if constexpr (requires(_Size_type _Val) { _STD bit_width(_Val); }) {
if constexpr (requires { _STD bit_width(_Compile_time_max_size<_Rng>); }) {
return _STD bit_width(_Compile_time_max_size<_Rng>);
} else {
return numeric_limits<_Size_type>::digits;
Expand Down
12 changes: 6 additions & 6 deletions stl/inc/tuple
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ template <class... _Types, class _Other, size_t... _Indices>
inline constexpr bool _Can_construct_values_from_tuple_like_v<tuple<_Types...>, _Other, index_sequence<_Indices...>> =
conjunction_v<is_constructible<_Types, decltype(_STD get<_Indices>(_STD declval<_Other>()))>...>;

#ifdef __clang__ // TRANSITION, LLVM-59827
#if defined(__clang__) || defined(__EDG__) // TRANSITION, LLVM-59827 and VSO-1900279
template <class _TupleLike, class _Tuple>
concept _Can_construct_from_tuple_like =
_Different_from<_TupleLike, _Tuple> && _Tuple_like<_TupleLike> && !_Is_subrange_v<remove_cvref_t<_TupleLike>>
Expand All @@ -195,16 +195,16 @@ concept _Can_construct_from_tuple_like =
&& (tuple_size_v<_Tuple> != 1
|| (!is_convertible_v<_TupleLike, tuple_element_t<0, _Tuple>>
&& !is_constructible_v<tuple_element_t<0, _Tuple>, _TupleLike>) );
#endif // defined(__clang__)
#endif // defined(__clang__) || defined(__EDG__)

template <class _TTuple, class _UTuple, class _Indices = make_index_sequence<tuple_size_v<_UTuple>>>
struct _Three_way_comparison_result_with_tuple_like {};

template <class... _TTypes, class _UTuple, size_t... _Indices>
requires
#ifndef __clang__ // TRANSITION, DevCom-10265237
#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, DevCom-10265237
(sizeof...(_TTypes) == sizeof...(_Indices)) &&
#endif // !defined(__clang__)
#endif // ^^^ workaround ^^^
(requires { typename _Synth_three_way_result<_TTypes, tuple_element_t<_Indices, _UTuple>>; } && ...)
struct _Three_way_comparison_result_with_tuple_like<tuple<_TTypes...>, _UTuple, index_sequence<_Indices...>> {
using type = common_comparison_category_t<_Synth_three_way_result<_TTypes, tuple_element_t<_Indices, _UTuple>>...>;
Expand Down Expand Up @@ -432,7 +432,7 @@ public:
negation_v<conjunction<is_convertible<decltype(_STD get<0>(_STD declval<_Other>())), _This>,
is_convertible<decltype(_STD get<_Indices + 1>(_STD declval<_Other>())), _Rest>...>>;

#ifdef __clang__ // TRANSITION, LLVM-59827
#if defined(__clang__) || defined(__EDG__) // TRANSITION, LLVM-59827 and VSO-1900279
template <class _Other, enable_if_t<_Can_construct_from_tuple_like<_Other, tuple>, int> = 0>
#else // ^^^ workaround / no workaround vvv
template <_Different_from<tuple> _Other>
Expand Down Expand Up @@ -540,7 +540,7 @@ public:
: tuple(_Alloc_unpack_tuple_t{}, _Al, _STD move(_Right)) {}

#ifdef __cpp_lib_concepts
#ifdef __clang__ // TRANSITION, LLVM-59827
#if defined(__clang__) || defined(__EDG__) // TRANSITION, LLVM-59827 and VSO-1900279
template <class _Alloc, class _Other, enable_if_t<_Can_construct_from_tuple_like<_Other, tuple>, int> = 0>
#else // ^^^ workaround / no workaround vvv
template <class _Alloc, _Different_from<tuple> _Other>
Expand Down
6 changes: 3 additions & 3 deletions stl/inc/utility
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ concept _Tuple_like = _Tuple_like_impl<remove_cvref_t<_Ty>>;
template <class _Ty>
concept _Pair_like = _Tuple_like<_Ty> && tuple_size_v<remove_cvref_t<_Ty>> == 2;

#ifdef __clang__ // TRANSITION, LLVM-59827
#if defined(__clang__) || defined(__EDG__) // TRANSITION, LLVM-59827 and VSO-1900279
template <class _PairLike, class _Ty1, class _Ty2>
concept _Can_construct_from_pair_like = _Pair_like<_PairLike> && !_Is_subrange_v<remove_cvref_t<_PairLike>>
&& is_constructible_v<_Ty1, decltype(_STD get<0>(_STD declval<_PairLike>()))>
&& is_constructible_v<_Ty2, decltype(_STD get<1>(_STD declval<_PairLike>()))>;
#endif // defined(__clang__)
#endif // defined(__clang__) || defined(__EDG__)
#endif // _HAS_CXX23
#endif // defined(__cpp_lib_concepts)

Expand Down Expand Up @@ -289,7 +289,7 @@ struct pair { // store a pair of values
: first(_STD forward<const _Other1>(_Right.first)), second(_STD forward<const _Other2>(_Right.second)) {}

#ifdef __cpp_lib_concepts
#ifdef __clang__ // TRANSITION, LLVM-59827
#if defined(__clang__) || defined(__EDG__) // TRANSITION, LLVM-59827 and VSO-1900279
template <class _Other, enable_if_t<_Can_construct_from_pair_like<_Other, _Ty1, _Ty2>, int> = 0>
#else // ^^^ workaround / no workaround vvv
template <_Pair_like _Other>
Expand Down
8 changes: 4 additions & 4 deletions stl/inc/xutility
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ struct _Get_rebind_alias<_Ty, _Other, void_t<typename _Ty::template rebind<_Othe
};

#if _HAS_CXX20
#ifdef __EDG__ // TRANSITION, DevCom-1691516
#if defined(__clang__) || defined(__EDG__) // TRANSITION, DevCom-1691516
// per LWG-3888
_EXPORT_STD template <class _Ty, class... _Types,
class = void_t<decltype(::new(static_cast<void*>(_STD declval<_Ty*>())) _Ty(_STD declval<_Types>()...))>>
Expand Down Expand Up @@ -3972,6 +3972,9 @@ struct _Move_iterator_category {

_EXPORT_STD template <class _Iter>
class move_iterator : public _Move_iterator_category<_Iter> {
private:
_Iter _Current{};

public:
using iterator_type = _Iter;
using value_type = _Iter_value_t<_Iter>;
Expand Down Expand Up @@ -4211,9 +4214,6 @@ public:
_NODISCARD constexpr iterator_type&& _Get_current() && noexcept {
return _STD move(_Current);
}

private:
iterator_type _Current{};
};

_EXPORT_STD template <class _Iter1, class _Iter2>
Expand Down
Loading