Skip to content

[SYCL] Fix invalid use of std::move in SemaTemplateInstantiateDecl.cpp #6868

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

Merged
merged 1 commit into from
Sep 23, 2022

Conversation

erichkeane
Copy link
Contributor

This being used in a loop with more than one multiversion function would likely cause that mangle-context to be invalid. Also, the unqualified move is discouraged.

This patch just changes the code slightly to have the lambda capture the entire unique_ptr by reference.

This being used in a loop with more than one multiversion function
would likely cause that mangle-context to be invalid.  Also, the
unqualified move is discouraged.

This patch just changes the code slightly to have the lambda capture the
entire unique_ptr by reference.
@erichkeane erichkeane requested a review from a team as a code owner September 23, 2022 13:47
@elizabethandrews
Copy link
Contributor

This doesn't look like a SYCL specific change. So is there a reason this is not being done in community clang instead? Also, is there a test you can add since this isn't a NFC. I assume this is fixing a crash/mis-compilation

@erichkeane
Copy link
Contributor Author

This doesn't look like a SYCL specific change. So is there a reason this is not being done in community clang instead? Also, is there a test you can add since this isn't a NFC. I assume this is fixing a crash/mis-compilation

This IS a SYCL specific change, this code (processFunctionInstantiation) doesn't exist in the upstream.

I don't have a reproducer for the crash. READING the code, I'd expect it should, but it doesn't (Aaron and I both read it and are surprised). There are tests that SHOULD run into this, but no idea why they dont. My best guess is the host compiler doing us favors with inlining. The motivation for the change is the unqualified use of 'move', which I couldn't in good conscience JUST qualify when it was so broken. (that is, make move into std::move);

@AlexeySachkov AlexeySachkov merged commit 71bdc1f into intel:sycl Sep 23, 2022
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.

6 participants