[LLVMbugs] [Bug 21787] __has_trivial_constructor is true for lambdas
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Dec 9 10:53:02 PST 2014
http://llvm.org/bugs/show_bug.cgi?id=21787
Richard Smith <richard-llvm at metafoo.co.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |richard-llvm at metafoo.co.uk
Resolution|--- |INVALID
--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
You shouldn't be calling __has_trivial_constructor; it's an implementation
detail for use by the standard library. And even then, it should not be used
because it's mostly meaningless; __is_trivially_constructible should be used
instead.
Also, just because the default constructor is deleted, that doesn't make it
non-trivial. Note that both GCC and Clang accept this:
struct S { S() = delete; };
static_assert(__has_trivial_constructor(S), "");
Since GCC rejects the corresponding case with a lambda, for which the default
constructor is supposed to be defined as in the above example, this seems to be
a GCC bug.
--
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/2017ce21/attachment.html>
More information about the llvm-bugs
mailing list