diff --git a/sycl/source/detail/device_impl.hpp b/sycl/source/detail/device_impl.hpp index f091680af9d32..463c29a7c4360 100644 --- a/sycl/source/detail/device_impl.hpp +++ b/sycl/source/detail/device_impl.hpp @@ -503,7 +503,7 @@ class device_impl : public std::enable_shared_from_this { // descriptor first when defining the cache data member). For "CallOnce" // cache we want to be querying cached value so "false" is the right // template parameter for such delegation. - constexpr bool DependentFalse = InitializingCache && false; + [[maybe_unused]] constexpr bool DependentFalse = InitializingCache && false; if constexpr (decltype(MCache)::has() && !InitializingCache) { return MCache.get();