<html>
<head>
<base href="http://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 failed: Ptr must be a pointer to Val type!"
href="http://llvm.org/bugs/show_bug.cgi?id=22855">22855</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Assertion failed: Ptr must be a pointer to Val type!
</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>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>jonathan.sauer@gmx.de
</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>Created <span class=""><a href="attachment.cgi?id=14011" name="attach_14011" title="Full log">attachment 14011</a> <a href="attachment.cgi?id=14011&action=edit" title="Full log">[details]</a></span>
Full log
The following program crashes clang r231653, while it compiled with clang
r230218:
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),
__size_(__s)
{}
};
}
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.</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>