diff --git a/core/src/Kokkos_Complex.hpp b/core/src/Kokkos_Complex.hpp index 08ce0bbb29f..23d8d9c1a4d 100644 --- a/core/src/Kokkos_Complex.hpp +++ b/core/src/Kokkos_Complex.hpp @@ -38,8 +38,10 @@ template KOKKOS_FUNCTION constexpr auto&& complex_get( ComplexForwardingRef&& z) noexcept { static_assert(I < 2); - if constexpr (I == 0) return static_cast(z).re_; - if constexpr (I == 1) return static_cast(z).im_; + if constexpr (I == 0) + return static_cast(z).re_; + else + return static_cast(z).im_; } } // namespace Impl