From d15589711de5c79e10baf0e1b169320ee565b953 Mon Sep 17 00:00:00 2001 From: Ronan Keryell Date: Fri, 3 Dec 2021 09:23:07 -0800 Subject: [PATCH] [SYCL][NFC] Fix special member functions for GCC 11.2 and C++20 (#5068) I got an issue while compiling the SYCL runtime on Ubuntu 21.10 G++ 11.2 and C++20. Please add more modern configurations to your GitHub Actions to test at least with the latest compilers and latest languages. While SYCL 2020 requires at least a C++17 compiler, it should not break with C++20 or C++2b. --- sycl/include/CL/sycl/nd_item.hpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sycl/include/CL/sycl/nd_item.hpp b/sycl/include/CL/sycl/nd_item.hpp index db92989d03b52..77c00829120de 100644 --- a/sycl/include/CL/sycl/nd_item.hpp +++ b/sycl/include/CL/sycl/nd_item.hpp @@ -163,22 +163,20 @@ template class nd_item { Group.wait_for(events...); } - nd_item(const nd_item &rhs) = default; + nd_item(const nd_item &rhs) = default; - nd_item(nd_item &&rhs) = default; + nd_item(nd_item &&rhs) = default; - nd_item &operator=(const nd_item &rhs) = default; + nd_item &operator=(const nd_item &rhs) = default; - nd_item &operator=(nd_item &&rhs) = default; + nd_item &operator=(nd_item &&rhs) = default; - bool operator==(const nd_item &rhs) const { + bool operator==(const nd_item &rhs) const { return (rhs.localItem == this->localItem) && (rhs.globalItem == this->globalItem) && (rhs.Group == this->Group); } - bool operator!=(const nd_item &rhs) const { - return !((*this) == rhs); - } + bool operator!=(const nd_item &rhs) const { return !((*this) == rhs); } protected: friend class detail::Builder;