From 1b1fa2d37d5d117cf826a9616bf30181dc9c77cf Mon Sep 17 00:00:00 2001 From: Chris Perkins Date: Mon, 4 Aug 2025 16:27:42 -0700 Subject: [PATCH 1/2] variadic_iterator is used by several routines that are marked as noexcept, some being API. Changing its operator++ to be noexcept to prevent issues and put Coverity's mind at ease --- sycl/source/detail/helpers.hpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/sycl/source/detail/helpers.hpp b/sycl/source/detail/helpers.hpp index a5612cd2211e5..475fd69e01af5 100644 --- a/sycl/source/detail/helpers.hpp +++ b/sycl/source/detail/helpers.hpp @@ -59,23 +59,18 @@ template class variadic_iterator { template variadic_iterator(IterTy &&It) : It(std::forward(It)) {} - variadic_iterator &operator++() { - It = std::visit( - [](auto &&It) { - ++It; - return storage_iter{It}; - }, - It); + variadic_iterator &operator++() noexcept { + std::visit([](auto &&It) noexcept { ++It; }, It); return *this; } - bool operator!=(const variadic_iterator &Other) const { + bool operator!=(const variadic_iterator &Other) const noexcept{ return It != Other.It; } - bool operator==(const variadic_iterator &Other) const { + bool operator==(const variadic_iterator &Other) const noexcept{ return It == Other.It; } - decltype(auto) operator*() { + decltype(auto) operator*() noexcept { return std::visit( [](auto &&It) -> decltype(auto) { decltype(auto) Elem = *It; From 15dbcbac294bbf758bb431bd3f6a2238a2d05544 Mon Sep 17 00:00:00 2001 From: Chris Perkins Date: Mon, 4 Aug 2025 16:32:33 -0700 Subject: [PATCH 2/2] clang format Signed-off-by: Chris Perkins --- sycl/source/detail/helpers.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sycl/source/detail/helpers.hpp b/sycl/source/detail/helpers.hpp index 475fd69e01af5..3ad3645748339 100644 --- a/sycl/source/detail/helpers.hpp +++ b/sycl/source/detail/helpers.hpp @@ -63,10 +63,10 @@ template class variadic_iterator { std::visit([](auto &&It) noexcept { ++It; }, It); return *this; } - bool operator!=(const variadic_iterator &Other) const noexcept{ + bool operator!=(const variadic_iterator &Other) const noexcept { return It != Other.It; } - bool operator==(const variadic_iterator &Other) const noexcept{ + bool operator==(const variadic_iterator &Other) const noexcept { return It == Other.It; }