[PATCH] D35056: GCC ABI incompatibility when passing object with trivial copy ctor, trivial dtor, and non-trivial move ctor

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 24 14:09:45 PDT 2017


rsmith added inline comments.


================
Comment at: lib/AST/DeclCXX.cpp:1476
+
+  data().HasNonDeletedCopyOrMoveConstructor = !CopyOrMoveDeleted;
 }
----------------
This is wrong. "Has a non-deleted copy or move constructor" is not the same thing as "does not have a deleted copy or move constructor". And you will also need to check for the case where the class notionally has such a constructor, but where we have lazily not yet declared it -- in that case, you may need to do arbitrary work (including template instantiation etc) to figure out whether the constructor should be deleted.

Please move this check into `Sema` and pass a bool to `completeDefinition` with the result of the check. That way you will have the tools available to compute the correct value in the case where you need to trigger the declaration of a constructor to determine the right answer.


https://reviews.llvm.org/D35056





More information about the cfe-commits mailing list