[LLVMbugs] [Bug 23764] Clang and GCC disagree about triviality of type with defaulted non-const copy constructor (breaks ABI!)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jun 4 22:56:02 PDT 2015


Kenton Varda <kenton at sandstorm.io> changed:

           What    |Removed                     |Added
             Status|RESOLVED                    |REOPENED
         Resolution|DUPLICATE                   |---

--- Comment #2 from Kenton Varda <kenton at sandstorm.io> ---
I don't think this is a duplicate of bug 21010. They both describe problems
related to copy triviality, but that bug describes a problem with destructors,
whereas this bug describes a different problem with constructors.

Moreover, this bug describes an ABI incompatibility with GCC which is causing
real-world crashes when trying to link a clang-built binary against a GCC-built
library or vice versa with valid code. In contrast, bug 21010 describes a case
that I don't think could lead to an ABI problem with valid code (since it
describes a class that shouldn't be allowed to be passed by value in the first

This ABI incompatibility is the primary concern in my bug. (I think my class C
may actually be non-trivially-copyable according to the standard, but that's
not primarily what I care about.)

It does seem like Richard's proposed rule would (perhaps accidentally?) solve
the problem:


This would at least solve the problem in my use cases because all my classes
that have a default non-const copy constructor also have a trivial move
constructor. It doesn't completely solve the problem in the case of a class
with non-trivial move constructor, but that does seem like an odd case.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150605/ae7a2228/attachment.html>

More information about the llvm-bugs mailing list