<html>
<head>
<base href="https://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 cannot deduce the template parameter when function parameter type is reference to array and template argument is braced-init-list" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23904&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=OMh2MFoguUQ5zXtxmkmz8Ggxb8FvdPnRqvx_-Xl7dsM&s=5VTnCEF5PeR59LCd8zZuy_UZsF437Pbtqh8sWTE1d8Q&e=">23904</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang cannot deduce the template parameter when function parameter type is reference to array and template argument is braced-init-list
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>boostcpp@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Clang cannot deduce the template parameter when function template's parameter
type is reference to array and template argument is braced-init-list.
void f( int (&&a)[3] ) { }
template < typename T, std::size_t N >
void g( T (&&a)[N] ) { }
template < typename T, std::size_t N >
void h( const T (&a)[N] ) { }
int main()
{
// GCC and Clang accept it
f( {1,2,3} ) ;
// GCC accept it
// Clang reject it
// couldn't infer template argument 'T'(and 'N' too)
g( {1,2,3} ) ;
h( {1,2,3} ) ;
}
I think GCC is right on here so template parameters can be deduced.</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>