<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 doesn't emit ctor call from template instantiations if it needs to perform initializer_list conversion"
href="http://llvm.org/bugs/show_bug.cgi?id=20445">20445</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang doesn't emit ctor call from template instantiations if it needs to perform initializer_list conversion
</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>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>C++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>vonosmas@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvmbugs@cs.uiuc.edu, nlewycky@google.com, richard-llvm@metafoo.co.uk
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Reproducer:
$ cat tmp/ilistbug/b.cc
#include <stdio.h>
#include <vector>
class MyClass {
public:
explicit MyClass(const std::vector<int> &v) {
printf("MyClass::MyClass()\n");
}
};
template <int x>
class MyTest {
public:
MyTest() {
auto c = new MyClass({42, 43});
printf("Created MyClass: %p\n", c);
}
};
int main() {
MyTest<42> test;
return 0;
}
$ ./bin/clang++ -std=c++11 tmp/ilistbug/b.cc && ./a.out
Created MyClass: 0xb65010
Huh? MyClass is created, but its constructor is never called.
For some reason this code works fine if I make "MyTest" non-template class.
I'm pretty sure this is a recent regression, but I haven't bisected it yet.</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>