<html>
<head>
<base href="http://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 --- - __has_trivial_constructor is true for lambdas"
href="http://llvm.org/bugs/show_bug.cgi?id=21787">21787</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>__has_trivial_constructor is true for lambdas
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.5
</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>normal
</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>Balzs.Kdr.ext@dwpbank.de
</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>Created <span class=""><a href="attachment.cgi?id=13442" name="attach_13442" title="source">attachment 13442</a> <a href="attachment.cgi?id=13442&action=edit" title="source">[details]</a></span>
source
Lambdas have deleted default constructor per 5.1.2.20, but
__has_trivial_constructor is true.
Output:
$ clang++ --version
clang version 3.5.0 (tags/RELEASE_350/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
$ clang++ -std=c++11 clangbug.cpp
clangbug.cpp:7:50: error: implicit instantiation of undefined template
'pb<true>'
pb<__has_trivial_constructor(decltype(lambda))>
has_trivial_constructor;
^
clangbug.cpp:2:8: note: template is declared here
struct pb;
^
1 error generated.
GCC output for reference (__has_trivial_constructor is false):
$ g++ --version
g++ (GCC) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ g++ -std=c++11 clangbug.cpp
clangbug.cpp: In function ‘int main()’:
clangbug.cpp:7:50: error: aggregate ‘pb<false> has_trivial_constructor’ has
incomplete type and cannot be defined
pb<__has_trivial_constructor(decltype(lambda))> has_trivial_constructor;</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>