Skip to content

[SYCL] Add diagnostic to work group scoped destructors. - #23581

Merged
sarnex merged 2 commits into
intel:syclfrom
inteltdelisle:work/warnings/work_group_dtor
Oct 23, 2026
Merged

sarnex merged 2 commits into
intel:syclfrom
inteltdelisle:work/warnings/work_group_dtor

Conversation

@inteltdelisle

Copy link
Copy Markdown
Contributor

Non-trivial destructors are not currently supported in work group scopes. Depending on the backend, they either fail to link, are silently dropped, or cause other undefined behaviour. This change adds a warning message so users are made aware of this issue.

Added a regression test to cover this new warning.

Non-trivial destructors are not currently supported in work group
scopes. Depending on the backend, they either fail to link, are silently
dropped, or cause other undefined behaviour. This change adds a warning
message so users are made aware of this issue.

Added a regression test to cover this new warning.

Signed-off-by: Delisle, Thierry <thierry.delisle@intel.com>
@inteltdelisle

Copy link
Copy Markdown
Contributor Author

This PR is a result of #23461

@tahonermann tahonermann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @inteltdelisle, this looks pretty good to me. I requested a minor change to the diagnostic text and added a request for an additional note, if it isn't too difficult, to note where a capture occurs.

Comment thread clang/include/clang/Basic/DiagnosticSemaKinds.td Outdated
Comment thread clang/test/SemaSYCL/sycl-wg-dtor-warning.cpp Outdated
Signed-off-by: Delisle, Thierry <thierry.delisle@intel.com>

@tahonermann tahonermann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @inteltdelisle, this looks good to me. I agree about issuing that diagnostic note only for implicit captures.

@sys-ce-bb

Copy link
Copy Markdown
Contributor

@intel/llvm-gatekeepers please consider merging

@sarnex
sarnex merged commit d61deb7 into intel:sycl Oct 23, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants