Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit b6fa213

Browse files
mikednjkotas
authored andcommitted
Remove a few bogus reinterpret_cast(nullptr_t) (#17229)
reinterpret_cast cannot be used to convert nullptr_t values, so does C++ std says in a note. VC++ ignores this restriction claiming that notes are not normative. Clang enforces the restriction. Oh well...
1 parent 55f162d commit b6fa213

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/inc/utilcode.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5317,7 +5317,7 @@ inline T* InterlockedExchangeT(
53175317
std::nullptr_t value) // When nullptr is provided as argument.
53185318
{
53195319
//STATIC_ASSERT(value == 0);
5320-
return InterlockedExchangeT(target, reinterpret_cast<T*>(value));
5320+
return InterlockedExchangeT(target, static_cast<T*>(value));
53215321
}
53225322

53235323
template <typename T>
@@ -5327,7 +5327,7 @@ inline T* InterlockedCompareExchangeT(
53275327
T* comparand)
53285328
{
53295329
//STATIC_ASSERT(exchange == 0);
5330-
return InterlockedCompareExchangeT(destination, reinterpret_cast<T*>(exchange), comparand);
5330+
return InterlockedCompareExchangeT(destination, static_cast<T*>(exchange), comparand);
53315331
}
53325332

53335333
template <typename T>
@@ -5337,7 +5337,7 @@ inline T* InterlockedCompareExchangeT(
53375337
std::nullptr_t comparand) // When nullptr is provided as argument.
53385338
{
53395339
//STATIC_ASSERT(comparand == 0);
5340-
return InterlockedCompareExchangeT(destination, exchange, reinterpret_cast<T*>(comparand));
5340+
return InterlockedCompareExchangeT(destination, exchange, static_cast<T*>(comparand));
53415341
}
53425342

53435343
#undef InterlockedExchangePointer

0 commit comments

Comments
 (0)