<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - Failure to deduce template arguments for std::initializer_list aliases"
href="https://bugs.llvm.org/show_bug.cgi?id=40366">40366</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Failure to deduce template arguments for std::initializer_list aliases
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>7.0
</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++'17
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>davorin.ucakar@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Using an alias for std::initializer_list results in a failure to deduce
template arguments as in the following example (it compiles fine with GCC 8.2):
#include <initializer_list>
template <typename T>
using IL = std::initializer_list<T>;
template <typename T>
struct Foo {
Foo(IL<T> list) {}
};
int main() {
Foo foo{42}; // Error: no viable constructor or deduction guide
// for deduction of template arguments of 'Foo'
return 0;
}
However, the next deduction guide fixes the error:
template <typename T>
Foo(std::initializer_list<T>) -> Foo<T>;
The deduction guide doesn't work if we use IL<T> instead of
std::initializer<T>.</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>