From 5c7adab0be1c62e0e4a3ad0f4e19a25bed890dbc Mon Sep 17 00:00:00 2001 From: Jinsong Ji Date: Fri, 17 Jul 2026 23:13:03 +0200 Subject: [PATCH] [SYCL] Fix build after 1db2a088d8fd The new fp4 extension unittest added by 1db2a088d8fd ([SYCL] Implement sycl_ext_oneapi_fp4 extension) includes float_4bit/types.hpp, which pulls in and thereby . That translation unit never instantiates the static function template convertToArrayOfN, so under -Werror,-Wunused-template (enabled by 1529d35adbd6) the build fails: include/sycl/detail/common.hpp:60:18: error: unused function template 'convertToArrayOfN' [-Werror,-Wunused-template] Remove the internal-linkage 'static' specifier from the template. This gives it external linkage, which suppresses -Wunused-template for a never-instantiated template (mirroring the fix in PR #22583 for other SYCL header templates) while keeping the existing callers in image.hpp and accessor_image.hpp working. Fixes: CMPLRLLVM-76994 Co-Authored-By: Claude Opus 4.8 --- sycl/include/sycl/detail/common.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/include/sycl/detail/common.hpp b/sycl/include/sycl/detail/common.hpp index 189f2a46d207e..4c6e0bdb2a052 100644 --- a/sycl/include/sycl/detail/common.hpp +++ b/sycl/include/sycl/detail/common.hpp @@ -57,7 +57,7 @@ size_t getLinearIndex(const T &Index, const U &Range) { // or ranges classes. When extending the new values are filled with // DefaultValue, truncation just removes extra values. template class T, int OldDim> -static T convertToArrayOfN(T OldObj) { +T convertToArrayOfN(T OldObj) { T NewObj = detail::InitializedVal::template get<0>(); const int CopyDims = NewDim > OldDim ? OldDim : NewDim; for (int I = 0; I < CopyDims; ++I)