[llvm-bugs] [Bug 37947] New: [Windows] Assigning a base class pointer to a derived class causes an assertion in clang

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 26 15:02:00 PDT 2018


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

            Bug ID: 37947
           Summary: [Windows] Assigning a base class pointer to a derived
                    class causes an assertion in clang
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: stilis at microsoft.com
                CC: llvm-bugs at lists.llvm.org

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
}
```

-- 
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/20180626/aa91f616/attachment.html>


More information about the llvm-bugs mailing list