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

Peter Collingbourne peter at pcc.me.uk
Fri Sep 19 14:33:58 PDT 2014


================
Comment at: include/clang/Basic/Attr.td:545
@@ +544,3 @@
+def CUDAInvalidTarget : InheritableAttr {
+  let Spellings = [GNU<"invalid_target">];
+  let Subjects = SubjectList<[Function]>;
----------------
This doesn't seem like it should have a spelling.

================
Comment at: lib/Sema/SemaCUDA.cpp:101
@@ +100,3 @@
+  assert((Target1 != Sema::CFT_Global && Target2 != Sema::CFT_Global) &&
+         "Special members cannot be marked global");
+
----------------
Is there anything preventing a special member from being manually marked as global? (Apparently not; this parses without errors with a recent clang:)

    struct A {
      __attribute__((global)) A() {}
    };

================
Comment at: lib/Sema/SemaDeclCXX.cpp:10438
@@ -10402,1 +10437,3 @@
   CopyConstructor->setDefaulted();
+  CopyConstructor->setImplicit();
+
----------------
It looks like this is already set by the `/*isImplicitlyDeclared=*/true` parameter passed to `CXXConstructorDecl::Create`.

================
Comment at: lib/Sema/SemaDeclCXX.cpp:10611
@@ -10567,1 +10610,3 @@
   MoveConstructor->setDefaulted();
+  MoveConstructor->setImplicit();
+
----------------
Likewise.

http://reviews.llvm.org/D5199






More information about the cfe-commits mailing list