================
@@ -1031,6 +1031,20 @@ void Sema::InstantiateAttrs(const 
MultiLevelTemplateArgumentList &TemplateArgs,
       continue;
     }
 
+    // Check address space sizes for CUDA/HIP variable attributes now that we
+    // know the type of the instantiation.
+    if (auto *NewVar = dyn_cast<VarDecl>(New)) {
+      if ((isa<CUDADeviceAttr>(TmplAttr) || isa<HIPManagedAttr>(TmplAttr)) &&
+          !CheckVarDeclSizeAddressSpace(NewVar, LangAS::cuda_device))
----------------
arsenm wrote:

This should not require going through this short list of attribute to address 
space. This should work for any address space 

https://github.com/llvm/llvm-project/pull/180756
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to