[clang] [CUDA][HIP] Fix CTAD for host/device constructors (PR #168711)

Corentin Jabot via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 27 04:29:36 PST 2025


================
@@ -7984,6 +7984,19 @@ void Sema::ProcessDeclAttributeList(
     }
   }
 
+  // CUDA/HIP: disallow explicit CUDA target attributes on deduction guides.
+  // Deduction guides are not callable functions and never participate in
+  // codegen; they are always treated as host+device for CUDA/HIP semantic
+  // checks, so explicit target attributes on them would be misleading noise.
----------------
cor3ntin wrote:

```suggestion
  // checks, so explicit target attributes on them would be misleading.
```

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


More information about the cfe-commits mailing list