Skip to content

Commit 17f6d56

Browse files
AlexGutenievAZero13
authored andcommitted
Clean up unnecessary (void) casts (microsoft#2280)
1 parent 41d5b05 commit 17f6d56

File tree

3 files changed

+0
-7
lines changed

3 files changed

+0
-7
lines changed

stl/inc/functional

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,6 @@ public:
815815
private:
816816
_Mybase* _Copy(void* _Where) const override {
817817
if constexpr (_Is_large<_Func_impl_no_alloc>) {
818-
(void) _Where; // TRANSITION, DevCom-1004719
819818
return _Global_new<_Func_impl_no_alloc>(_Callee);
820819
} else {
821820
return ::new (_Where) _Func_impl_no_alloc(_Callee);
@@ -824,7 +823,6 @@ private:
824823

825824
_Mybase* _Move(void* _Where) noexcept override {
826825
if constexpr (_Is_large<_Func_impl_no_alloc>) {
827-
(void) _Where; // TRANSITION, DevCom-1004719
828826
return nullptr;
829827
} else {
830828
return ::new (_Where) _Func_impl_no_alloc(_STD move(_Callee));

stl/inc/variant

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,6 @@ struct _Variant_construct_visitor { // visitor that constructs the same alternat
754754
disjunction_v<bool_constant<_Idx == variant_npos>, is_nothrow_constructible<remove_reference_t<_Ty>, _Ty>>) {
755755
// initialize _Idx-th item in _Self from _Source
756756
_STL_INTERNAL_CHECK(_Self.valueless_by_exception());
757-
(void) _Source; // TRANSITION, DevCom-1004719
758757
if constexpr (_Idx != variant_npos) {
759758
_Construct_in_place(_Self._Storage(), integral_constant<size_t, _Idx>{}, static_cast<_Ty&&>(_Source._Val));
760759
_Self._Set_index(_Idx);
@@ -777,7 +776,6 @@ struct _Variant_assign_visitor { // visitor that implements assignment for varia
777776
is_nothrow_constructible<_Remove_cvref_t<_Ty>, _Ty>>>) {
778777
// assign the _Idx-th alternative of _Self from _Source
779778
if constexpr (_Idx == variant_npos) { // assign from valueless _Source
780-
(void) _Source; // TRANSITION, DevCom-1004719
781779
_Self._Reset();
782780
} else {
783781
if (_Self._Which == _Idx) { // same alternative: assign directly
@@ -1349,7 +1347,6 @@ struct _Variant_relop_visitor2 { // evaluate _Op with the contained value of two
13491347
if constexpr (_Idx != variant_npos) {
13501348
return _Op{}(_Variant_raw_get<_Idx>(_Left), _Right._Val);
13511349
} else { // return whatever _Op returns for equal values
1352-
(void) _Right; // TRANSITION, DevCom-1004719
13531350
return _Op{}(0, 0);
13541351
}
13551352
}
@@ -1475,7 +1472,6 @@ struct _Variant_dispatcher<index_sequence<_Is...>> {
14751472
template <class _Ret, class _Callable, class... _Types, bool _Any_valueless = ((_Is == 0) || ...)>
14761473
_NODISCARD static constexpr _Ret _Dispatch2(_Callable&& _Obj, _Types&&... _Args) {
14771474
if constexpr (_Any_valueless) {
1478-
(void) _Obj; // TRANSITION, DevCom-1004719
14791475
((void) _Args, ...); // TRANSITION, DevCom-1004719
14801476
_Throw_bad_variant_access();
14811477
}

stl/inc/xmemory

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,6 @@ struct _Normal_allocator_traits { // defines traits for allocators
563563
template <class _Ty, class... _Types>
564564
static _CONSTEXPR20 void construct(_Alloc& _Al, _Ty* _Ptr, _Types&&... _Args) {
565565
if constexpr (_Uses_default_construct<_Alloc, _Ty*, _Types...>::value) {
566-
(void) _Al; // TRANSITION, DevCom-1004719
567566
#if _HAS_CXX20
568567
_STD construct_at(_Ptr, _STD forward<_Types>(_Args)...);
569568
#else // _HAS_CXX20

0 commit comments

Comments
 (0)