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

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 1 16:17:06 PDT 2022


tra 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
----------------
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
```


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