Skip to content

Commit

Permalink
Work around spurious "missing return statement" warnings for NVCC and…
Browse files Browse the repository at this point in the history
… Intel compilers (#1102)

Work around spurious "missing return statement" warning

NVCC < 11.5 and classic Intel < 2021.07 produce spurious warning about
missing return statement in `else` branch of the `if constexpr`. This
works around it.

Co-authored-by: Jared Crean <jccrean@sandia.gov>
  • Loading branch information
JaredCrean2 and Jared Crean authored Jun 7, 2024
1 parent dbdf574 commit 0bc3cab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/details/ArborX_DetailsLegacy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ class LegacyValues
expand(bounding_volume, Access::get(_primitives, i));
return value_type{bounding_volume, (index_type)i};
}
#if (defined(KOKKOS_COMPILER_NVCC) && (KOKKOS_COMPILER_NVCC < 1150)) || \
(defined(KOKKOS_COMPILER_INTEL) && (KOKKOS_COMPILER_INTEL <= 2021))
// FIXME_NVCC, FIXME_INTEL: workaround for spurios "missing return
// statement at end of non-void function" warning
return value_type{};
#endif
}

KOKKOS_FUNCTION
Expand Down

0 comments on commit 0bc3cab

Please sign in to comment.