<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 - Fails to deduce template type for repeated argument of the same type"
href="https://bugs.llvm.org/show_bug.cgi?id=40302">40302</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Fails to deduce template type for repeated argument of the same type
</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>FreeBSD
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</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>yuri@tsoft.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=21318" name="attach_21318" title="test.cpp">attachment 21318</a> <a href="attachment.cgi?id=21318&action=edit" title="test.cpp">[details]</a></span>
test.cpp
The attached testcase passes several lambda functions of the same type to the
function 'test'. clang fails to use the single template type for all arguments.
It succeeds only when the same type is listed several times, once per argument.
Failure:
test.cpp:11:3: error: no matching function for call to 'test'
test(
^~~~
test.cpp:4:13: note: candidate template ignored: deduced conflicting types for
parameter 'Fn' ('(lambda at test.cpp:12:5)' vs. '(lambda at test.cpp:12:30)')
static void test(Fn &&fn1, Fn &&fn2, Fn &&fn3) { }
^
1 error generated.
Please note that '(lambda at test.cpp:12:5)' and '(lambda at test.cpp:12:30)'
are of the same type.</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>