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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to