<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:Balzs.Kdr.ext@dwpbank.de" title="Balázs Kádár <Balzs.Kdr.ext@dwpbank.de>"> <span class="fn">Balázs Kádár</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED --- - __has_trivial_constructor is true for lambdas"
   href="http://llvm.org/bugs/show_bug.cgi?id=21787">bug 21787</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>RESOLVED
           </td>
           <td>REOPENED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>INVALID
           </td>
           <td>---
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED --- - __has_trivial_constructor is true for lambdas"
   href="http://llvm.org/bugs/show_bug.cgi?id=21787#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED --- - __has_trivial_constructor is true for lambdas"
   href="http://llvm.org/bugs/show_bug.cgi?id=21787">bug 21787</a>
              from <span class="vcard"><a class="email" href="mailto:Balzs.Kdr.ext@dwpbank.de" title="Balázs Kádár <Balzs.Kdr.ext@dwpbank.de>"> <span class="fn">Balázs Kádár</span></a>
</span></b>
        <pre>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.)</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>