<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 --- - Bad diagnostic when wrong type passed to initializer list"
href="http://llvm.org/bugs/show_bug.cgi?id=19602">19602</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Bad diagnostic when wrong type passed to initializer list
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.4
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>sidney@s4y.us
</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=12453" name="attach_12453" title="Test case">attachment 12453</a> <a href="attachment.cgi?id=12453&action=edit" title="Test case">[details]</a></span>
Test case
When I compile the test case (which initializes a container with an initializer
list of `const char*`s who expects a type which can only be constructed from
`std::string`s), I get this error:
```
test.cpp:15:28: error: no matching constructor for initialization of
'container<const thing>'
container<const thing> c{
^~
test.cpp:10:5: note: candidate constructor not viable: requires 1 argument, but
3 were provided
container(std::initializer_list<T>) {}
^
test.cpp:9:8: note: candidate constructor (the implicit copy constructor) not
viable: requires 1 argument, but 3 were provided
struct container {
^
test.cpp:9:8: note: candidate constructor (the implicit move constructor) not
viable: requires 1 argument, but 3 were provided
1 error generated.
```
The errors imply that matching failed because the wrong number of arguments
were passed to the constructor, which is misleading.</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>