[PATCH] Fix PR20495: correct inference of the CUDA target for implicit members

Eli Bendersky eliben at google.com
Thu Sep 25 17:56:20 PDT 2014


PTAL

================
Comment at: lib/Sema/SemaDeclCXX.cpp:1
@@ -1,2 +1,1 @@
-//===------ SemaDeclCXX.cpp - Semantic Analysis for C++ Declarations ------===//
 //
----------------
pcc wrote:
> I assume this was a mistake.
Yes, sorry. Fixing.

================
Comment at: test/SemaCUDA/implicit-member-target.cu:146
@@ +145,3 @@
+
+struct B7_with_copy_assign {
+};
----------------
pcc wrote:
> This should derive from `A7_with_copy_assign`, right?
Done

================
Comment at: test/SemaCUDA/implicit-member-target.cu:150
@@ +149,3 @@
+void hostfoo7() {
+  A7_with_copy_assign a1, a2;
+  a1 = a2;
----------------
pcc wrote:
> Please update this test once your other patch lands and add the other tests Richard asked for.
Done.

Note that in the case of the move constructor, the error message is not great. I presume this is because Sema tries to find the copy ctor after the move ctor doesn't match due to target; then since the move ctor is defined, the copy ctor is deleted - hence the message.

http://reviews.llvm.org/D5199






More information about the cfe-commits mailing list