<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 --- - MS ABI: Delay member pointer inheritance model lock-in until a complete type is required"
   href="http://llvm.org/bugs/show_bug.cgi?id=18479">18479</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>MS ABI: Delay member pointer inheritance model lock-in until a complete type is required
          </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>Frontend
          </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>david.majnemer@gmail.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Blocks</th>
          <td>12477
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Right now we lock in the inheritance model of a member pointer in the Microsoft
C++ ABI when we build the type.  This means we use the unspecified inheritance
model (3 ints) for this code:

struct A;
void f(int A::*mp);
struct A { };
int main() { f(0); }

MSVC uses the single inheritance non-polymorphic model (1 int, null is -1) for
this code because it waits until it sees "f(0)" to decide on the size.  We can
probably get much better compatibility if we wait until RequireCompleteType()
is called on the member pointer type to decide the inheritance model.

Rather than stapling new attributes to the class decl like we currently do, we
could add a mutable enum field to MemberPointerType to hold the inheritance
model.  The model is determined once and it stays the same for that type
throughout the rest of the TU, so we can sidestep the immutability of Type. 
The inheritance model should *not* be part of the MemberPointerType profile, we
only need the pointee type and the class type.</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>