[LLVMbugs] [Bug 21787] New: __has_trivial_constructor is true for lambdas
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Dec 9 02:03:41 PST 2014
http://llvm.org/bugs/show_bug.cgi?id=21787
Bug ID: 21787
Summary: __has_trivial_constructor is true for lambdas
Product: clang
Version: 3.5
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: unassignedclangbugs at nondot.org
Reporter: Balzs.Kdr.ext at dwpbank.de
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
Created attachment 13442
--> http://llvm.org/bugs/attachment.cgi?id=13442&action=edit
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;
--
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/20141209/d2133875/attachment.html>
More information about the llvm-bugs
mailing list