Skip to content

[SYCL] h_item move members should be explicitly noexcept and follow the rule of five #23397

Description

@Robertkq

Describe the bug

Follow-up to #23184: h_item's move constructor and move assignment are = default without the noexcept required since KhronosGroup/SYCL-Docs#1044. It also declares only four of the five special members, so it's missing the destructor that the rule of five requires (4.5.3).

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

The fix in sycl/include/sycl/h_item.hpp:

h_item(h_item &&hi) noexcept = default;
h_item &operator=(h_item &&hi) noexcept = default;
~h_item() = default;

h_item stays trivially copyable and trivially destructible with this change. I will work on this PR.

Activity

  1. Robertkq commented on Oct 7, 2026

    @Robertkq
    ContributorAuthor
  2. KornevNikita commented on Oct 7, 2026

    @KornevNikita
    Contributor

    @KornevNikita FYI

    thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions