Skip to content

Commit

Permalink
Fix availability of is_constant_evaluated on old MSVC (#1180) (#1198)
Browse files Browse the repository at this point in the history
@ptheywood found that there is an unfortunate incompatability of MSVC2019 which does support `__builtin_is_constant_evaluated` from 19.24 onwards and old nvcc below 11.3 which does not.

Fix this by hardening the condition we use to detect availability

Fixes #1179
  • Loading branch information
miscco committed Dec 13, 2023
1 parent 7552e97 commit f664be7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libcudacxx/include/cuda/std/detail/libcxx/include/__config
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ extern "C++" {

#if __check_builtin(builtin_is_constant_evaluated) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 900) \
|| (defined(_LIBCUDACXX_COMPILER_MSVC) && _MSC_VER > 1924)
|| (defined(_LIBCUDACXX_COMPILER_MSVC) && _MSC_VER > 1924 && !defined(_LIBCUDACXX_CUDACC_BELOW_11_3))
#define _LIBCUDACXX_IS_CONSTANT_EVALUATED(...) __builtin_is_constant_evaluated(__VA_ARGS__)
#endif // __check_builtin(builtin_is_constant_evaluated)

Expand Down

0 comments on commit f664be7

Please sign in to comment.