-
- Downloads
[SYCL] Diagnose uses of zero length arrays
Adds diagnosing on attempt to use zero length arrays, pointers, refs, arrays of them and structs/classes containing all of it. In case a struct/class with zero length array is used this emits a set of notes pointing out how zero length array got into used struct, like this: ``` struct ContainsArr { int A[0]; // note: field of illegal type declared here }; struct Wrapper { ContainsArr F; // note: within field of type ContainsArr declared here // ... } // Device code Wrapper W; W.use(); // error: zero-length arrays are not permitted ``` Total deep check of each used declaration may result in double diagnosing at the same location. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D114080
Showing
- clang/include/clang/Basic/DiagnosticSemaKinds.td 1 addition, 1 deletionclang/include/clang/Basic/DiagnosticSemaKinds.td
- clang/include/clang/Sema/Sema.h 3 additions, 0 deletionsclang/include/clang/Sema/Sema.h
- clang/lib/Sema/Sema.cpp 9 additions, 0 deletionsclang/lib/Sema/Sema.cpp
- clang/lib/Sema/SemaSYCL.cpp 98 additions, 0 deletionsclang/lib/Sema/SemaSYCL.cpp
- clang/lib/Sema/SemaType.cpp 1 addition, 1 deletionclang/lib/Sema/SemaType.cpp
- clang/test/SemaSYCL/zero-length-arrays.cpp 125 additions, 0 deletionsclang/test/SemaSYCL/zero-length-arrays.cpp
Loading
Please register or sign in to comment