[LLVMbugs] [Bug 22855] New: Assertion failed: Ptr must be a pointer to Val type!

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 9 09:08:08 PDT 2015


            Bug ID: 22855
           Summary: Assertion failed: Ptr must be a pointer to Val type!
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jonathan.sauer at gmx.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 14011
  --> http://llvm.org/bugs/attachment.cgi?id=14011&action=edit
Full log

The following program crashes clang r231653, while it compiled with clang

namespace std
    using size_t = decltype(sizeof(int));

    // simplified from libc++'s initializer_list header
    template<class _Ep>
    class initializer_list
        const _Ep* __begin_;
        size_t    __size_;

        initializer_list(const _Ep* __b, size_t __s)
            : __begin_(__b),

struct Foo {
    int m;

    constexpr Foo(int t) : m(t) {}

struct Bar {
    Foo a;
    unsigned char b;

int main()
    std::initializer_list<Bar> r{
        { { 1 }, 1 },
    (void) r;

This results in (full log attached):

% ~/LLVM/build/Release+Asserts/bin/clang++ -std=c++11 clang.cpp
Assertion failed: (getOperand(0)->getType() ==
cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a
pointer to Val type!"), function AssertOK, file
/Users/rynnsauer/LLVM/llvm/lib/IR/Instructions.cpp, line 1033.

The code compiles as expected when Foo's constructor is not constexpr.

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/20150309/675c72a9/attachment.html>

More information about the llvm-bugs mailing list