<html>
    <head>
      <base href="https://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 --- - Assertion failure on packed derived class" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D24020&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=5hUCzXzSRcg-K8BBTEfuzvM1UtAuABoPG4jO2C-Ndlg&s=czU1YrCn2SIlP81w3d0GGEh2juCc41VJF7wUtHwjmRw&e=">24020</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failure on packed derived class
          </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>sunil_srivastava@playstation.sony.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>Following example gives Assertion failure
---------------------------------------
struct Base
{
    char one;
    short two;
};

struct BasePacked {
    char one;
    short two;
} __attribute__((packed));
struct DerivedPacked : public BasePacked { int three; };
int FuncForDerivedPacked(DerivedPacked d)
{
    return d.three;
}
---------------------------------------------------

clang version 3.7.0 (trunk 241287)
Target: x86_64-unknown-linux-gnu


$clang++  -cc1 -emit-obj  -triple x86_64-unknown-linux-gnu ul.cpp
clang-3.7: /llvm/tools/clang/lib/CodeGen/TargetInfo.cpp:1821: static
{anonymous}::X86_64ABIInfo::Class
{anonymous}::X86_64ABIInfo::merge({anonymous}::X86_64ABIInfo::Class,
{anonymous}::X86_64ABIInfo::Class): Assertion `(Accum != Memory && Accum !=
ComplexX87) && "Invalid accumulated classification during merge."' failed</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>