Skip to content

"550494 Variable copied when it could be moved" in sycl-jit #21913

@KornevNikita

Description

@KornevNikita

Describe the bug

CID 550494: (#1 of 1): Variable copied when it could be moved (COPY_INSTEAD_OF_MOVE)
copy_constructor_call: PCHFS is passed-by-value as parameter to IntrusiveRefCntPtr, when it could be moved instead.[show details]
     	Use std::move(PCHFS) instead of PCHFS.

auto OverlayFS =
llvm::makeIntrusiveRefCnt<llvm::vfs::OverlayFileSystem>(VFS);
OverlayFS->pushOverlay(PCHFS);
VFS = std::move(OverlayFS);

To reproduce

  1. Include a code snippet that is as short as possible
  2. Specify the command which should be used to compile the program
  3. Specify the command which should be used to launch the program
  4. Indicate what is wrong and what was expected

Environment

  • OS: [e.g Windows/Linux]
  • Target device and vendor: [e.g. Intel GPU]
  • DPC++ version: [e.g. commit hash or output of clang++ --version]
  • Dependencies version: [e.g. the output of sycl-ls --verbose]

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions