Skip to content

Commit 6a39355

Browse files
committed
Work around NVC++ bug with partial spec of var template
The development branch of NVC++ currently has a regression where the compiler sometimes gets confused about the type of a partial specialization of a variable template with a deduced type. Work around this bug by changing the type of `__v<__mconstant<_Np>>` from `auto` to the equivalent `decltype(_Np)`.
1 parent 0242ad9 commit 6a39355

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

include/stdexec/__detail/__meta.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,9 @@ namespace stdexec {
121121
template <class _Tp, _Tp _Ip>
122122
inline constexpr _Tp __v<std::integral_constant<_Tp, _Ip>> = _Ip;
123123

124+
// `decltype(_Np)` instead of `auto` to work around NVHPC/EDG bug.
124125
template <auto _Np>
125-
inline constexpr auto __v<__mconstant<_Np>> = _Np;
126+
inline constexpr decltype(_Np) __v<__mconstant<_Np>> = _Np;
126127

127128
template <std::size_t _Np>
128129
inline constexpr std::size_t __v<__u8 (*)[_Np]> = _Np - 1; // see definition of __msize_t

0 commit comments

Comments
 (0)