<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 - Assertion failure laying out class hierarchy on i686-windows-msvc"
   href="https://bugs.llvm.org/show_bug.cgi?id=36748">36748</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failure laying out class hierarchy on i686-windows-msvc
          </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>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </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>smeenai@fb.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk, rnk@google.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>% cat /tmp/reduced.cpp
struct S {
  S() {}
  S(const S &) {}
};

struct T {
  ~T() {}
};

struct U {
  U(S) {}
};

struct V : public T, public U {
  using U::U;
};

void f() {
  S s;
  V v(s);
}

% clang -cc1 -triple i686-windows-msvc -fexceptions -emit-llvm /tmp/reduced.cpp
clang: ../../../include/llvm/Support/Casting.h:255: typename
llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X =
clang::CXXMethodDecl; Y = const clang::Decl; typename llvm::cast_retty<X,
Y*>::ret_type = const clang::CXXMethodDecl*]: Assertion `isa<X>(Val) &&
"cast<Ty>() argument of incompatible type!"' failed.

Doesn't occur on x86_64. I can also trigger a slightly different assertion
failure by adding another class to the hierarchy:

struct W : public V {
  W(S s) : V(s) {}
};

void f() {
  S s;
  W w(s);
}

% clang -cc1 -triple i686-windows-msvc -fexceptions -emit-llvm
/tmp/reduced2.cpp
clang: ../../../tools/clang/include/clang/AST/RecordLayout.h:225:
clang::CharUnits clang::ASTRecordLayout::getBaseClassOffset(const
clang::CXXRecordDecl*) const: Assertion `CXXInfo->BaseOffsets.count(Base) &&
"Did not find base!"' failed.

I assume the underlying root cause is the same.</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>