[clang] [Clang/AMDGPU] Allow zero sized arrays in HIP device code (PR #195716)
Joseph Huber via cfe-commits
cfe-commits at lists.llvm.org
Tue May 5 06:39:30 PDT 2026
jhuber6 wrote:
> The motivation for the existing diagnostic came from customer reports about zero-sized `__shared__` arrays, where code accidentally wrote something like `__shared__ T x[0]` and confused it with the extensively used dynamic shared-memory form `extern __shared__ T x[];` that led to unclear failures, so the request was for a better compile-time diagnostic.
Was the issue the compiler or the user being confused. I'm assuming that this was fixed by the backend patches. If we're worried about users confusing it we could possibly make a diagnostic.
https://github.com/llvm/llvm-project/pull/195716
More information about the cfe-commits
mailing list