File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
tests/std/tests/P1206R7_vector_from_range Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -7720,7 +7720,7 @@ namespace ranges {
7720
7720
} else if constexpr (_Converts_constructible_insertable<_Rng, _Container, _Types...>) {
7721
7721
_Container _Cont(_STD forward<_Types>(_Args)...);
7722
7722
if constexpr (_Sized_and_reservable<_Rng, _Container>) {
7723
- _Cont.reserve(_RANGES size(_Range));
7723
+ _Cont.reserve(static_cast<range_size_t<_Container>>( _RANGES size(_Range) ));
7724
7724
}
7725
7725
_RANGES copy(_Range, _Container_inserter<range_reference_t<_Rng>>(_Cont));
7726
7726
return _Cont;
Original file line number Diff line number Diff line change @@ -3630,6 +3630,10 @@ namespace ranges {
3630
3630
constexpr explicit _Subrange_base(const _Size_type&) noexcept {}
3631
3631
};
3632
3632
3633
+ #if 1 // TRANSITION, VSO-1695918 - Warning C4324 incorrectly firing in the presence of `pragma pack`
3634
+ #pragma warning(push)
3635
+ #pragma warning(disable : 4324) // structure was padded due to alignment specifier
3636
+ #endif // TRANSITION, VSO-1695918 - Warning C4324 incorrectly firing in the presence of `pragma pack`
3633
3637
_EXPORT_STD template <input_or_output_iterator _It, sentinel_for<_It> _Se, subrange_kind _Ki>
3634
3638
requires (_Ki == subrange_kind::sized || !sized_sentinel_for<_Se, _It>)
3635
3639
class subrange : public _Subrange_base<_It, _Se, _Ki> {
@@ -3792,6 +3796,9 @@ namespace ranges {
3792
3796
return *this;
3793
3797
}
3794
3798
};
3799
+ #if 1 // TRANSITION, VSO-1695918 - Warning C4324 incorrectly firing in the presence of `pragma pack`
3800
+ #pragma warning(pop)
3801
+ #endif // TRANSITION, VSO-1695918 - Warning C4324 incorrectly firing in the presence of `pragma pack`
3795
3802
3796
3803
template <input_or_output_iterator _It, sentinel_for<_It> _Se>
3797
3804
subrange(_It, _Se) -> subrange<_It, _Se>;
Original file line number Diff line number Diff line change @@ -161,6 +161,11 @@ void test_vso1591034() {
161
161
assert (counted_item::count == 6 );
162
162
}
163
163
164
+ void test_LWG_3743 () { // COMPILE-ONLY
165
+ ranges::subrange r (views::iota (0ULL ) | views::take (5 ), 5 );
166
+ (void ) ranges::to<vector<unsigned long long >>(r, size_t {0 });
167
+ }
168
+
164
169
int main () {
165
170
// Validate views
166
171
test_copyable_views ();
You can’t perform that action at this time.
0 commit comments