<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 --- - [-cxx-abi microsoft] Calling convention mismatch for operator new/delete and potentially others"
   href="http://llvm.org/bugs/show_bug.cgi?id=17371">17371</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[-cxx-abi microsoft] Calling convention mismatch for operator new/delete and potentially others
          </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>rnk@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu, richard-llvm@metafoo.co.uk
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This is a link error when building SupportTests with clang-cl /fallback.

The mismatch looks like this:

$ dumpbin /symbols lib/IR/CMakeFiles/LLVMCore.dir/User.cpp.obj
unittests/Support/CMakeFiles/SupportTests.dir/ValueHandleTest.cpp.obj | grep
'User::operator new'
14A 00000180 SECT1  notype ()    External     | ??2User@llvm@@KEPAXII@Z
(protected: static void * __thiscall llvm::User::operator new(unsigned
int,unsigned int))
B9A 00000000 UNDEF  notype ()    External     | ??2User@llvm@@KAPAXII@Z
(protected: static void * __cdecl llvm::User::operator new(unsigned
int,unsigned int))


The key diff is __thiscall vs. __cdecl.

This is a bug in the calling convention change I committed.  Since operator new
is declared in a record context, we assume it's __thiscall, even though it has
no this pointer.  I assume we have a similar problem for delete, and maybe
other operators that I'm unaware of.</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>