[clang] [CUDA] Add support for __grid_constant__ attribute (PR #114589)

Artem Belevich via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 4 12:10:04 PST 2024


================
@@ -12222,8 +12222,17 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD,
             << NewFD;
     }
 
-    if (!Redeclaration && LangOpts.CUDA)
+    if (!Redeclaration && LangOpts.CUDA) {
----------------
Artem-B wrote:

My mental model of whether we should error/warn about `__grid_constant__` attribute is similar to that of `__inline__`. If compiler can do it - great. If not -- we can live with that, too.  Removing the attribute to silence the warning will have exactly the same effect as ignoring the attribute. No point bothering the user about that.

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


More information about the cfe-commits mailing list