yxsamliu wrote: Thanks, that makes sense. If this comes from marking libc++ macros such as `_LIBCPP_HIDE_FROM_ABI`, then I can see why requiring every redeclaration/definition in system headers to repeat the attrs would be painful.
I still think this has a readability cost in user code, since a bare definition may actually be compiled as H+D because of an earlier declaration. Could we add a warning for user-code redeclarations/definitions that inherit H+D this way, and suppress it in system headers? Users can silence it by spelling `__host__ __device__` on the definition. I also think implicit H+D should be handled consistently with explicit H+D here. Once Clang accepts two declarations into the same redecl chain, they should have the same effective CUDA target; otherwise different users of the redecl chain may see different targets depending on which `FunctionDecl` they inspect. https://github.com/llvm/llvm-project/pull/214911 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
