From 72afcf9f1c119a162191b15453a0b6998ff24f5e Mon Sep 17 00:00:00 2001 From: Nikita Kornev Date: Tue, 5 Aug 2025 11:25:10 +0200 Subject: [PATCH] [SYCL] Fix noexcept mismatch in HostKernel destructors (#19679) Marked base and derived destructors as noexcept to resolve compiler error: exception specification of overriding function is more lax than base version. --- sycl/include/sycl/detail/cg_types.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sycl/include/sycl/detail/cg_types.hpp b/sycl/include/sycl/detail/cg_types.hpp index 843db64dea661..034d93382d202 100644 --- a/sycl/include/sycl/detail/cg_types.hpp +++ b/sycl/include/sycl/detail/cg_types.hpp @@ -151,7 +151,7 @@ class HostKernelBase { // Return pointer to the lambda object. // Used to extract captured variables. virtual char *getPtr() = 0; - virtual ~HostKernelBase() = default; + virtual ~HostKernelBase() noexcept = default; #ifndef __INTEL_PREVIEW_BREAKING_CHANGES // NOTE: InstatiateKernelOnHost() should not be called. virtual void InstantiateKernelOnHost() = 0; @@ -169,7 +169,7 @@ class HostKernel : public HostKernelBase { char *getPtr() override { return reinterpret_cast(&MKernel); } - ~HostKernel() = default; + ~HostKernel() noexcept override = default; #ifndef __INTEL_PREVIEW_BREAKING_CHANGES // This function is needed for host-side compilation to keep kernels