<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW " title="NEW --- - Clang and GCC disagree about triviality of type with defaulted non-const copy constructor (breaks ABI!)" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23764&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=bAHH6BAM5OlGFmrpFuAyR14Q-Xdrcd_5LFZ0LtQnz2k&s=5vmtpnOyi9cHdpqeZYloWlNAyWd9R5g4UBPl0aA_ZQI&e=">23764</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang and GCC disagree about triviality of type with defaulted non-const copy constructor (breaks ABI!)
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.6
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>release blocker
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>kenton@sandstorm.io
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>The program below outputs 0 when compiled with Clang and 1 when compiled with
G++.
Unfortunately, this disagreement means that Clang and G++ implement different
argument-passing conventions for functions which take an argument with such a
type, and therefore libraries which use such types in their API (like Cap'n
Proto) cannot be used unless the library and caller are built with the same
compiler.
#include <iostream>
class C {
public:
C(C&) = default;
};
int main() {
std::cout << __has_trivial_copy(C) << std::endl;
return 0;
}</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>