Skip to content

[SYCL] Fix noexcept mismatch in HostKernel destructors #19679

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

Open
wants to merge 3 commits into
base: sycl
Choose a base branch
from

Conversation

KornevNikita
Copy link
Contributor

Marked base and derived destructors as noexcept to resolve compiler error: exception specification of overriding function is more lax than base version.

Marked base and derived destructors as noexcept to resolve compiler
error: exception specification of overriding function is more lax than base version.
@KornevNikita
Copy link
Contributor Author

@maarquitos14 could you take a look please

Copy link
Contributor

@maarquitos14 maarquitos14 left a comment

Choose a reason for hiding this comment

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

It's weird that the compiler complains about that, since none of them had noexcept before. Also, how come it didn't complain until now?

@KornevNikita
Copy link
Contributor Author

@maarquitos14 it looks like it

It's weird that the compiler complains about that, since none of them had noexcept before.

I guess, due to "default" keyword - implementation of these two destructors may differ - compiler may add "noexcept" to the base class, but not to the derived one (maybe because the latter is templated and hence more complicated). Looks like here in this repo we don't have such cases and in most cases both implementations have the same exception specification...

Also, how come it didn't complain until now?

...but, there are cases where they don't. If you're interested I can share a ticket offline, so you can check how this was found.

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.

2 participants