[clang] [Clang/AMDGPU] Allow zero sized arrays in HIP device code (PR #195716)

Brendon Cahoon via cfe-commits cfe-commits at lists.llvm.org
Tue May 5 07:35:33 PDT 2026


bcahoon wrote:

> A possible compromise is to allow `non-__shared__` zero-sized arrays in HIP device code, but keep a diagnostic for zero-sized `__shared__` variables to discourage that particular misuse. That would also address the issue my PR was trying to fix, since host/device functions in C++ headers could still use ordinary non-shared zero-sized arrays without being rejected during device compilation

I think this suggestion make sense.

Just fyi, there is more discussion about this issue here - https://github.com/llvm/llvm-project/pull/84742

https://github.com/llvm/llvm-project/pull/195716


More information about the cfe-commits mailing list