[PATCH] D130800: [clang][Headers] Avoid compiler warnings in builtin headers

Dominic Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 2 13:11:27 PDT 2022


ddcc added inline comments.


================
Comment at: clang/lib/Headers/__clang_cuda_builtin_vars.h:37
 
-#if __cplusplus >= 201103L
+#if defined(__cplusplus) && __cplusplus >= 201103L
 #define __DELETE =delete
----------------
tra wrote:
> Are there actual use cases where CUDA headers are used from a non-C++ compilation? I do not think they will compile with non-C++ compilation at all.
> 
> I'm curious how we managed to run into a situation where CUDA headers may be used w/o C++. 
> 
> I think a better fix here and other CUDA headers may be to add 
> ```
> #if !defined(__cplusplus)
> #error CUDA headers must be used from a CUDA/C++ compilation.
> #endif
> ```
Sure, I can do that. I'm not familiar with CUDA or its headers, so I previously just updated them all.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130800/new/

https://reviews.llvm.org/D130800



More information about the cfe-commits mailing list