[clang] [Clang/AMDGPU] Zero sized arrays not allowed in HIP device code. (PR #113470)
Eli Friedman via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 13 16:36:19 PST 2024
================
@@ -8732,6 +8732,18 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) {
}
}
+ // zero sized static arrays are not allowed in HIP device functions
+ if (getLangOpts().HIP &&
+ DeclAttrsMatchCUDAMode(getLangOpts(), getCurFunctionDecl())) {
----------------
efriedma-quic wrote:
The check there is `isDeviceSideDecl == LangOpts.CUDAIsDevice`... but you don't want to diagnose this on host, do you? (The regression test only checks the -fcuda-is-device case.)
https://github.com/llvm/llvm-project/pull/113470
More information about the cfe-commits
mailing list