[LLVMbugs] [Bug 21787] __has_trivial_constructor is true for lambdas

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Dec 10 00:59:31 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=21787

Balázs Kádár <Balzs.Kdr.ext at dwpbank.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

--- Comment #2 from Balázs Kádár <Balzs.Kdr.ext at dwpbank.de> ---
I wasn't calling it directly. I was using the boost range library.
My original code was of this form:
{
    using namespace boost::adaptors;
    std::vector<struct X> x;
    boost::join( x | transformed(lambda1) | filtered(lambda2), separator);
}
This compiles and works correctly with GCC and MSVC, but fails to compile with
Clang. The difference between Clang and GCC was that on Clang the iterator
returned by transformed didn't satisfy ForwardRangeConcept because it wasn't
default constructible because boost didn't wrap the lambda into boost::optional
because boost::has_trivial_default_constructor was true for the lambda because
BOOST_HAS_TRIVIAL_CONSTRUCTOR is implemented as __has_trivial_constructor(T)
(on all of GCC, MSVC and Clang) which is false on GCC and true on Clang.

So if it is correct in Clang, is it a bug in both GCC and Boost?

(Also all the clang docs say about __has_trivial_constructor is that it should
be working as it does with GCC and MSVC.)

-- 
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/20141210/1edc776e/attachment.html>


More information about the llvm-bugs mailing list