[clang] [clang][Sema][CUDA,SPIRV] Instantiating function templates duplicates GPU attrs (PR #218582)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 25 04:46:43 PDT 2026


================
@@ -5465,15 +5465,19 @@ static void handleGlobalAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
   if (FD->isInlineSpecified() && !S.getLangOpts().CUDAIsDevice)
     S.Diag(FD->getBeginLoc(), diag::warn_kern_is_inline) << FD;
 
-  if (AL.getKind() == ParsedAttr::AT_DeviceKernel)
-    D->addAttr(::new (S.Context) DeviceKernelAttr(S.Context, AL));
-  else
+  // ***REVIEWER***: the existing code clearly expects either DeviceKernel or
----------------
jhuber6 wrote:

Leftover?

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


More information about the cfe-commits mailing list