<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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] Assigning a base class pointer to a derived class causes an assertion in clang"
   href="https://bugs.llvm.org/show_bug.cgi?id=37947">37947</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[Windows] Assigning a base class pointer to a derived class causes an assertion in clang
          </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>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>stilis@microsoft.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This reproduces when trying to run one of the LLDB tests on Windows
(specifically, TestCallOverriddenMethod.py).

To reproduce:

1) Build Clang on Windows with LLVM_ENABLE_ASSERTIONS=ON
2) Build the source for TestCallOverriddenMethod.py

Result:

Assertion failed: Prior->Kind == MemberInfo::Field && !Prior->FD && "Only
storage fields have tail padding!", file
e:\_work\1\s\llvm\tools\clang\lib\codegen\cgrecordlayoutbuilder.cpp, line 596

The source for the test is:

```
class Base {
public:
  virtual ~Base() {}
  virtual void foo() {}
};

class Derived : public Base {
public:
  virtual void foo() {}
};

int main() {
  Derived d;
  Base *b = &d;
  return 0; // Set breakpoint here
}
```</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>