Skip to content

Commit

Permalink
Fix with overloading issue with clang 17
Browse files Browse the repository at this point in the history
  In file included from cuco/static_map.cuh:26:
  In file included from cuco/static_map_ref.cuh:200:
  cuco/detail/static_map/static_map_ref.inl:152:88: error:
        __host__ function 'with' cannot overload __host__ __device__ function 'with'
    152 | auto static_map_ref<Key, T, Scope, KeyEqual, ProbingScheme, StorageRef, Operators...>::with(
        |                                                                                        ^
  cuco/static_map_ref.cuh:177:42: note:
        previous declaration is here
    177 |   [[nodiscard]] __host__ __device__ auto with(NewOperators... ops) && noexcept;
        |                                          ^

The forward declaration isn't working, just inline it in the header.

Signed-off-by: Austin Schuh <[email protected]>
  • Loading branch information
AustinSchuh committed Nov 16, 2023
1 parent 9a299e8 commit 436ac7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
15 changes: 0 additions & 15 deletions include/cuco/detail/static_map/static_map_ref.inl
Original file line number Diff line number Diff line change
Expand Up @@ -141,21 +141,6 @@ static_map_ref<Key, T, Scope, KeyEqual, ProbingScheme, StorageRef, Operators...>
return impl_.empty_value_sentinel();
}

template <typename Key,
typename T,
cuda::thread_scope Scope,
typename KeyEqual,
typename ProbingScheme,
typename StorageRef,
typename... Operators>
template <typename... NewOperators>
auto static_map_ref<Key, T, Scope, KeyEqual, ProbingScheme, StorageRef, Operators...>::with(
NewOperators...) && noexcept
{
return static_map_ref<Key, T, Scope, KeyEqual, ProbingScheme, StorageRef, NewOperators...>(
std::move(*this));
}

namespace detail {

template <typename Key,
Expand Down
5 changes: 4 additions & 1 deletion include/cuco/static_map_ref.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ class static_map_ref
* @return `*this` with `NewOperators...`
*/
template <typename... NewOperators>
[[nodiscard]] __host__ __device__ auto with(NewOperators... ops) && noexcept;
[[nodiscard]] __host__ __device__ auto with(NewOperators...) && noexcept {
return static_map_ref<Key, T, Scope, KeyEqual, ProbingScheme, StorageRef, NewOperators...>(
std::move(*this));
}

private:
impl_type impl_; ///< Static map ref implementation
Expand Down

0 comments on commit 436ac7e

Please sign in to comment.