================
@@ -8714,6 +8714,21 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) {
     }
   }
 
+  // zero sized static arrays are not allowed in HIP device functions
+  if (LangOpts.CUDAIsDevice && LangOpts.HIP) {
+    if (FunctionDecl *FD = getCurFunctionDecl();
+        FD &&
+        (FD->hasAttr<CUDADeviceAttr>() || FD->hasAttr<CUDAGlobalAttr>())) {
----------------
efriedma-quic wrote:

Is there not some common helper for "will the current context be built for 
device"?  This seems like it should be common enough to show up in multiple 
places.

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

Reply via email to