jlebar added a comment.

To close the loop, we talked about this IRL, and I agree this is the most sane 
option we can come up with.  The user-facing principle is that the signatures 
of function template specializations must match.  We consider CUDA attributes 
to be part of the function's signature.  Therefore the target attributes should 
match.

Now the question is, should the *implicit plus explicit* or *only explicit* 
target attributes match?  To me, implicit+explicit makes more sense on face.  
But the problem is, we need to allow C++ code like

  constexpr template<typename T> void foo(T);
  template<> void foo(int);

We implicitly make constexpr functions HD.  The template specialization is not 
constexpr, so is not implicitly HD.  But we cannot disallow this code, because 
it's valid C++.  That effectively constrains our choice above to *only 
explicit* target attributes.


https://reviews.llvm.org/D25845



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to