<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 --- - Clang crashes on certain (brace-)conversion from char to int in functions of classtemplates"
href="http://llvm.org/bugs/show_bug.cgi?id=16894">16894</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang crashes on certain (brace-)conversion from char to int in functions of classtemplates
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.3
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</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>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>florian.weber@sfz-bw.de
</td>
</tr>
<tr>
<th>CC</th>
<td>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=11038" name="attach_11038" title="The complete commandline">attachment 11038</a> <a href="attachment.cgi?id=11038&action=edit" title="The complete commandline">[details]</a></span>
The complete commandline
Clang 3.3 on x86_64-unknown-linux-gnu crashes on the following code:
void gun(int){}
template<typename>
struct foo{
void fun () {
char i = 0;
gun(int{i});
}
};
int main () {
foo<void> bar;
bar.fun();
}
The relevant diagnostics are:
fatal error: error in backend: Cannot select: 0x272b3b0: i32 = bitcast
0x272adb0 [ORD=5] [ID=9]
0x272adb0: i8 = Constant<0> [ORD=3] [ID=4]
In function: _ZN3fooIvE3funEv
clang: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
“un-templating” the classtemplate, doing the conversion outside a function-call
and doing the conversion from a temporary variable (“gun(int{char{0}})”) all
make the issue vanish.</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>