-
Notifications
You must be signed in to change notification settings - Fork 809
[SYCL] Reject zero length arrays #1153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
eaa10ea
e9dd04a
765d43b
fb3d2ac
9618333
cc9aa9f
8d92c4d
17a2f44
b8a67d3
e28c09e
8634c6e
0a208a1
b515e70
a1c2eb3
11b2e94
7d7a2ec
77a5c88
f63f410
dd87de2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,108 @@ | ||||
| // RUN: %clang_cc1 -fcxx-exceptions -triple spir64 -fsycl-is-device -Wno-return-type -verify -fsyntax-only -std=c++17 %s | ||||
cperkinsintel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||
|
|
||||
| /* | ||||
| ensuring that the SYCL diagnostics that are typically deferred, correctly emit | ||||
| */ | ||||
cperkinsintel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||
|
|
||||
| struct S { | ||||
| virtual void foo() {} | ||||
| }; | ||||
|
|
||||
| int calledFromKernel(int a){ | ||||
| // expected-error@+1 {{zero-length arrays are not permitted in C++}} | ||||
| int MalArray[0]; | ||||
|
|
||||
| // expected-error@+1 {{__float128 is not supported on this target}} | ||||
| __float128 malFloat = 40; | ||||
|
|
||||
| // not sure if 'no virtual function' is a _deferred_ diagnostic, testing anyway | ||||
|
||||
| << Sema::KernelCallVirtualFunction; |
But we already diagnose variadic function calls through deferred diagnostic, I remember patch from Erich doing this #998 .
So If here you are trying to check only deferred diagnostics, I suggest switch from virtual functions to variadic functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I switched to variadic.
Fznamznon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this array A is needed at all?
The problem with diagnostics appears only if single_task function is called from a template function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. The diagnostics do not emit if the lambda that contains the violations appears in a templated function. So I'm just using the array to specialize the template.
Uh oh!
There was an error while loading. Please reload this page.