Skip to content

Commit e730649

Browse files
authored
Improve [[gnu::*]] attribute detection (NVIDIA#4502)
1 parent 436cde6 commit e730649

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libcudacxx/include/cuda/std/__cccl/attributes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103

104104
#if _CCCL_CUDA_COMPILER(NVCC, >=, 12, 5)
105105
# define _CCCL_PURE __nv_pure__
106-
#elif _CCCL_HAS_CPP_ATTRIBUTE(pure) || _CCCL_COMPILER(CLANG)
106+
#elif _CCCL_HAS_CPP_ATTRIBUTE(gnu::pure)
107107
# define _CCCL_PURE [[gnu::pure]]
108108
#elif _CCCL_COMPILER(MSVC)
109109
# define _CCCL_PURE __declspec(noalias)
@@ -112,7 +112,7 @@
112112
#endif
113113

114114
#if !_CCCL_COMPILER(MSVC) // _CCCL_HAS_CPP_ATTRIBUTE(const) doesn't work with MSVC
115-
# if _CCCL_HAS_CPP_ATTRIBUTE(const) || _CCCL_COMPILER(CLANG)
115+
# if _CCCL_HAS_CPP_ATTRIBUTE(gnu::const)
116116
# define _CCCL_CONST [[gnu::const]]
117117
# else
118118
# define _CCCL_CONST _CCCL_PURE

0 commit comments

Comments
 (0)