[llvm-bugs] [Bug 36748] New: Assertion failure laying out class hierarchy on i686-windows-msvc

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Mar 15 00:29:31 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=36748

            Bug ID: 36748
           Summary: Assertion failure laying out class hierarchy on
                    i686-windows-msvc
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: smeenai at fb.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk, rnk at google.com

% 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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180315/bcf7c0db/attachment.html>


More information about the llvm-bugs mailing list