[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

Alexey Bader via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 25 01:01:30 PST 2021


bader added a comment.

LGTM, with a couple of minor suggestions.



================
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) {
----------------



================
Comment at: clang/lib/Sema/SemaSYCL.cpp:125
+
+    // In case pointer/array/reference type is met get pointeetype, then proceed
+    // with that type.
----------------



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