[clang] [clang][SYCL] Diagnose variadic sycl_external function (PR #216393)

Tom Honermann via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 19 11:49:18 PDT 2026


================
@@ -13545,6 +13545,8 @@ def err_sycl_external_invalid_main : Error<
   "%0 cannot be applied to the 'main' function">;
 def err_sycl_external_invalid_deleted_function : Error<
   "%0 cannot be applied to an explicitly deleted function">;
+def err_sycl_external_invalid_variadic_function : Error<
+  "%0 cannot be applied to a variadic function">;
----------------
tahonermann wrote:

@Fznamznon, it makes me so happy to see you still contributing to SYCL here! ❤️

Are you suggesting that the `[[clang::sycl_external]]` attribute be ignored (with a warning) when applied to a variadic function? If so, I think that is a good idea. Your observation that there is no point in emitting a function that can't be called or have its address taken is exactly right.

https://github.com/llvm/llvm-project/pull/216393


More information about the cfe-commits mailing list