Skip to content

Commit

Permalink
One more fix
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Oct 4, 2024
1 parent 2914051 commit 4ec86ce
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions thrust/thrust/iterator/permutation_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,19 +168,22 @@ class permutation_iterator : public thrust::detail::permutation_iterator_base<El
*/

private:
// MSVC 2013 and 2015 incorrectly warning about returning a reference to
// a local/temporary here.
// See goo.gl/LELTNp
// MSVC incorrectly warning about returning a reference to a local/temporary here.
// NVHPC breaks with push / pop within a class
#if defined(_CCCL_COMPILER_MSVC)
_CCCL_DIAG_PUSH
_CCCL_DIAG_SUPPRESS_MSVC(4172)
#endif // _CCCL_COMPILER_MSVC

_CCCL_EXEC_CHECK_DISABLE
_CCCL_HOST_DEVICE typename super_t::reference dereference() const
{
return *(m_element_iterator + *this->base());
}

#if defined(_CCCL_COMPILER_MSVC_2017)
_CCCL_DIAG_POP
#endif // _CCCL_COMPILER_MSVC_2017

// make friends for the copy constructor
template <typename, typename>
Expand Down

0 comments on commit 4ec86ce

Please sign in to comment.