================ @@ -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>())) { ---------------- VigneshwarJ wrote:
The reuse of that DeclAttrsMatchCUDAMode with some rechecks doesn't make sense because that function returns true if decl is not defined. So, inturn I have to check if its inside a functionDecl again else it will wrongly diagnose host global zero array as not permitted. 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