<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 --- - MicrosoftRecordLayoutBuilder yields wrong info on the presence of vfptr"
   href="http://llvm.org/bugs/show_bug.cgi?id=17845">17845</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>MicrosoftRecordLayoutBuilder yields wrong info on the presence of vfptr
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </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>timurrrr@google.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>Steps to repro as of r194205:

1) Apply the following diff:
----------------------------------------------
Index: lib/AST/RecordLayoutBuilder.cpp
===================================================================
--- lib/AST/RecordLayoutBuilder.cpp    (revision 194256)
+++ lib/AST/RecordLayoutBuilder.cpp    (working copy)
@@ -2904,6 +2904,9 @@
   bool HasOwnVFPtr = Layout.hasOwnVFPtr();
   bool HasOwnVBPtr = Layout.hasOwnVBPtr();

+  if (IndentLevel == 1)
+    OS << (Layout.hasVFPtr() ? "-- has vfptr --\n" : "-- doesn't have vfptr
--\n");
+
   // Vtable pointer.
   if (RD->isDynamicClass() && !PrimaryBase && !isMsLayout(RD)) {
     PrintOffset(OS, Offset, IndentLevel);
----------------------------------------------

2) Dump the AST layout for the following code:
----------------------------------------------
class X { virtual void f(); int x; };
class A : virtual X { int a; };
----------------------------------------------
I get this:
----------------------------------------------
*** Dumping AST Record Layout
   0 | class A
-- doesn't have vfptr --
   0 |   (A vbtable pointer)
   4 |   int a
   8 |   class X (virtual base)
   8 |     (X vftable pointer)
  12 |     int x
----------------------------------------------

It's pretty clear that the result of Layout.hasVFPtr() is wrong.</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>