<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - __has_trivial_constructor is true for lambdas"
href="http://llvm.org/bugs/show_bug.cgi?id=21787">bug 21787</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>REOPENED
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>mclow.lists@gmail.com
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>FIXED
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - __has_trivial_constructor is true for lambdas"
href="http://llvm.org/bugs/show_bug.cgi?id=21787#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - __has_trivial_constructor is true for lambdas"
href="http://llvm.org/bugs/show_bug.cgi?id=21787">bug 21787</a>
from <span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=21787#c2">comment #2</a>)
<span class="quote">> So if it is correct in Clang, is it a bug in both GCC and Boost?</span >
It's sort-of a bug in GCC, and very likely to be a bug in boost. boost is
relying on a property that is not guaranteed by this trait: the fact that a
type T has a trivial default constructor does *not* imply that the expression
T() is well-formed.
boost will presumably do the wrong thing under GCC if your callable object has
a private defaulted default constructor (for which __has_trivial_constructor is
true but the type is not trivially constructible).
<span class="quote">> (Also all the clang docs say about __has_trivial_constructor is that it
> should be working as it does with GCC and MSVC.)</span >
It essentially does. The difference is that internally Clang decides
(correctly, per C++11) that the closure type has a trivial default constructor,
and GCC and MSVC presumably do not.
Now, we voted a last-minute change into C++14 that says closure types have no
default constructor rather than having a deleted default constructor, and that
will make __has_trivial_constructor(LambdaType) always be false. I've
implemented that in r223953, which should make the symptom here go away, but
the root cause (that boost is misusing this broken-by-design type trait) will
remain.</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>