<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 --- - candidate template ignored: substitution failure(error with clang but not with g++)" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D24211&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=LnOnZHZdZMOPfiSluf31r_cqbn1BMu3_3YSYzmeD-XA&s=RjRijl3PPhIekAewMEHoF1WUU2DeOi8dLUzqFnmqZDs&e=">24211</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>candidate template ignored: substitution failure(error with clang but not with g++)
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</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>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>1532708160@qq.com
</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>// g++ compiles the next code, but clang++ not
template<int dim, int loop>
class Reference{
public:
//...
template<int r, int c> using matrix_t = int[r][c];
Reference(const matrix_t<dim, loop> &mat){}
};
template<int dim, int loop>
class Partition{
// ...
public:
// ...
template<int r, int c> using matrix = int[r][c];
template<int r, int c> void readPattern(const matrix<r,c> &pattern)
{
// ...
}
// ...
};
int main()
{
// ...
const int DENOISE_UR[3][4] = {/*...*/};
Partition<1,2> partition;
partition.readPattern(DENOISE_UR);
// ...
}
/////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// only move one of the alias template ahead of the two class definition
// g++ compiles the next code, so as clang++
template<int r, int c> using matrix = int[r][c];
template<int dim, int loop>
class Reference{
public:
//...
template<int r, int c> using matrix_t = int[r][c];
Reference(const matrix_t<dim, loop> &mat){}
};
template<int dim, int loop>
class Partition{
// ...
public:
// ...
template<int r, int c> void readPattern(const matrix<r,c> &pattern)
{
// ...
}
// ...
};
int main()
{
// ...
const int DENOISE_UR[3][4] = {/*...*/};
Partition<1,2> partition;
partition.readPattern(DENOISE_UR);
// ...
}</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>