[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays
Mariya Podchishchaeva via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 29 07:04:26 PST 2021
Fznamznon marked an inline comment as not done.
Fznamznon added inline comments.
================
Comment at: clang/lib/Sema/SemaSYCL.cpp:68-75
+ bool ErrorFound = false;
+ if (isZeroSizedArray(*this, TypeToCheck)) {
+ SYCLDiagIfDeviceCode(UsedAt, diag::err_sycl_zero_array_size);
+ ErrorFound = true;
+ }
+ // Checks for other types can also be done here.
+ if (ErrorFound) {
----------------
bader wrote:
>
I'm not sure about this suggestion. I've made this place this way so It is easy to extend it to diagnose other types (for example variable length arrays). Is it ok if I leave it as is?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114080/new/
https://reviews.llvm.org/D114080
More information about the cfe-commits
mailing list