diff options
author | Mariya Podchishchaeva <mariya.podchishchaeva@intel.com> | 2021-12-29 13:46:15 +0300 |
---|---|---|
committer | Mariya Podchishchaeva <mariya.podchishchaeva@intel.com> | 2021-12-29 15:30:18 +0300 |
commit | 52e8f58d49e63aaf6f4c1682bb787bcbfd240009 (patch) | |
tree | e72ce9d3b4622e089c9ff58bbb5f7246ce58159d /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 3ad32df72eb2063ba45ec2956a815e1bbb6e6012 (diff) | |
download | llvm-52e8f58d49e63aaf6f4c1682bb787bcbfd240009.zip llvm-52e8f58d49e63aaf6f4c1682bb787bcbfd240009.tar.gz llvm-52e8f58d49e63aaf6f4c1682bb787bcbfd240009.tar.bz2 |
[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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions