<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [Windows] C++ objects are passed as byval when using Itanium C++ ABI"
   href="http://llvm.org/bugs/show_bug.cgi?id=16390">16390</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[Windows] C++ objects are passed as byval when using Itanium C++ ABI
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>reid.kleckner@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This is because C and C++ structs on Windows are passed directly in argument
stack slots.

However, for C++ objects this is actually totally broken, since they have to be
copied with the copy ctor.  Furthermore, those objects are cleaned up by the
callee, which isn't consistent with Itanium or standard C++.  Implementing this
corner of the C++ ABI is covered by <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [-cxx-abi microsoft] C++ objects passed by value are constructed in place on the argument stack slots"
   href="show_bug.cgi?id=16226">http://llvm.org/bugs/show_bug.cgi?id=16226</a>
.

If we're targetting win32 (not mingw or cygwin) and we're using the Itanium C++
ABI, then we fail to call the copy ctor on these objects.

Long term, it's not actually clear if we want to support our own hybrid win32 C
ABI + Itanium C++ ABI where we pass standard layout structs byval and C++
objects indirectly.  I'd much rather force users to pick between a mingw ABI
and a win32 ABI which encompasses both C and C++.</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>