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

2024-10-29 Thread Ognyan Mirev via cfe-commits

https://github.com/OgnianM edited 
https://github.com/llvm/llvm-project/pull/114056
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2024-10-29 Thread Ognyan Mirev via cfe-commits

https://github.com/OgnianM edited 
https://github.com/llvm/llvm-project/pull/114056
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2024-10-29 Thread Ognyan Mirev via cfe-commits


@@ -91,12 +91,14 @@ __device__ inline void operator delete[](void *ptr,
 #endif
 
 // Device overrides for placement new and delete.
+#if _LIBCPP_STD_VER < 26

OgnianM wrote:

Looks like it
https://github.com/gcc-mirror/gcc/blob/9dd9a88b75334bc079b8ab5fb2dbb5d56765bd60/libstdc%2B%2B-v3/libsupc%2B%2B/new#L198-L214

I have an older version of libstdc++ on my system, so I can't easily test it, 
but it looks like changing this to
`#if _LIBCPP_STD_VER < 26 || __cpp_lib_constexpr_new < 202406L` should work.


https://github.com/llvm/llvm-project/pull/114056
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2024-10-29 Thread Ognyan Mirev via cfe-commits

https://github.com/OgnianM edited 
https://github.com/llvm/llvm-project/pull/114056
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2024-10-30 Thread Ognyan Mirev via cfe-commits

https://github.com/OgnianM updated 
https://github.com/llvm/llvm-project/pull/114056

>From db9a3ff75fdaf5f838826c809f84dcc471420920 Mon Sep 17 00:00:00 2001
From: ognyan 
Date: Tue, 29 Oct 2024 15:38:34 +0200
Subject: [PATCH 1/2] Remove device override for operator new when the C++
 standard >= 26

---
 clang/lib/Headers/cuda_wrappers/new | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/clang/lib/Headers/cuda_wrappers/new 
b/clang/lib/Headers/cuda_wrappers/new
index d5fb3b7011de96..41dde0bf20403e 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
 __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 {}
 

>From 635829e015d5943e63c2440e6af4236dfb86bf32 Mon Sep 17 00:00:00 2001
From: ognyan 
Date: Wed, 30 Oct 2024 11:43:15 +0200
Subject: [PATCH 2/2] Change the #if to also check for the libstdc++ constexpr
 new

---
 clang/lib/Headers/cuda_wrappers/new | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2024-11-15 Thread Ognyan Mirev via cfe-commits

OgnianM wrote:

Ping

https://github.com/llvm/llvm-project/pull/114056
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2024-11-15 Thread Ognyan Mirev via cfe-commits

OgnianM wrote:

Yeah, am I supposed to do anything at this point or should I just leave it to 
you?


https://github.com/llvm/llvm-project/pull/114056
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits