Skip to content

Conversation

@AlexeySachkov
Copy link
Contributor

Input argument for this std::move is const &, meaning that the result is const &&. std::vector does not have a move constructor from const && and therefore it fallbacks to regular copy constructor taking const &.

Dropped that std::move to better describe what actually happens there. As a side effect, this change should help Coverity to stop stubmling upon this and complaining that some object is used after it was moved (see CID 535422).

Input argument for this `std::move` is `const &`, meaning that the
result is `const &&`. `std::vector` does not have a move constructor
from `const &&` and therefore it fallbacks to regular copy constructor
taking `const &`.

Dropped that `std::move` to better describe what actually happens there.
As a side effect, this change should help Coverity to stop stubmling
upon this and complaining that some object is used after it was moved
(see CID `535422`).
@AlexeySachkov
Copy link
Contributor Author

From what I understand, the unit-tests failures which are observed are the same as in #20454 which says that they are known and were addressed by #20451

@AlexeySachkov AlexeySachkov merged commit f577b0a into intel:sycl Oct 27, 2025
27 of 29 checks passed
AlexeySachkov added a commit to AlexeySachkov/llvm that referenced this pull request Oct 27, 2025
This is similar to intel#20455 - there is a bunch of places where
we call `std::move(const obj &)`, but target classes do not provide
`obj(const &&)` move constructors, falling back to regular `obj(const &)` copy
constructor, thus making the `std::move` useless and confusing.

This should also help clean up the Coverity scan
(https://scan.coverity.com/projects/intel-llvm?tab=overview), see CIDs
`535398`, `535480`, `535420` and `535554`. By some reason Coverity
thinks that we are using a moved object, whilst in fact no moves were
performed, only copies.
@AlexeySachkov AlexeySachkov deleted the private/asachkov/drop-confusing-move branch October 27, 2025 16:42
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