[clang] 9204eba - Remove device override for operator new when the C++ standard >= 26 (#114056)

via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 15 13:53:28 PST 2024


Author: Ognyan Mirev
Date: 2024-11-15T13:53:24-08:00
New Revision: 9204eba9121546c0e9c16d8a75d5735bad9dee16

URL: https://github.com/llvm/llvm-project/commit/9204eba9121546c0e9c16d8a75d5735bad9dee16
DIFF: https://github.com/llvm/llvm-project/commit/9204eba9121546c0e9c16d8a75d5735bad9dee16.diff

LOG: Remove device override for operator new when the C++ standard >= 26 (#114056)

Related to https://github.com/llvm/llvm-project/issues/114048

Added: 
    

Modified: 
    clang/lib/Headers/cuda_wrappers/new

Removed: 
    


################################################################################
diff  --git a/clang/lib/Headers/cuda_wrappers/new b/clang/lib/Headers/cuda_wrappers/new
index d5fb3b7011de96..9d3e31690e677c 100644
--- a/clang/lib/Headers/cuda_wrappers/new
+++ b/clang/lib/Headers/cuda_wrappers/new
@@ -91,12 +91,14 @@ __device__ inline void operator delete[](void *ptr,
 #endif
 
 // Device overrides for placement new and delete.
+#if !(_LIBCPP_STD_VER >= 26 || __cpp_lib_constexpr_new >= 202406L)
 __device__ inline void *operator new(__SIZE_TYPE__, void *__ptr) CUDA_NOEXCEPT {
   return __ptr;
 }
 __device__ inline void *operator new[](__SIZE_TYPE__, void *__ptr) CUDA_NOEXCEPT {
   return __ptr;
 }
+#endif
 __device__ inline void operator delete(void *, void *) CUDA_NOEXCEPT {}
 __device__ inline void operator delete[](void *, void *) CUDA_NOEXCEPT {}
 


        


More information about the cfe-commits mailing list