[PATCH] D25845: [CUDA] Ignore implicit target attributes during function template instantiation.

Justin Lebar via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 21 11:49:16 PDT 2016


jlebar added inline comments.


================
Comment at: test/SemaCUDA/function-template-overload.cu:62
+template <typename T> constexpr T overload_ce_implicit_hd(T a) { return a+1; }
+// expected-note at -1 3 {{candidate template ignored: target attributes do not match}}
+
----------------
Oh, I didn't know you could specify a count like this.  I have a bunch of tests to fix now!


================
Comment at: test/SemaCUDA/function-template-overload.cu:79
+template <> constexpr double overload_ce_implicit_hd(double a) { return a + 3.0; };
+
 __host__ void hf() {
----------------
D25809's patch description says:

> [New behavior]: Require matching target attributes for explicit function template instantiation/specialization and narrow [the] list of candidates to templates with the same target.

Based on this, I do not see why most of the "these should work" candidates work.

Rather than explain here, can you please add a comment to the test?

(At some point someone is probably going to have to write down and make sense of all of the semantics we have invented.  It's going to be a pain either way, but at least we can preserve our reasoning in code rather than phab comments.)


https://reviews.llvm.org/D25845





More information about the cfe-commits mailing list