<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 - References to functions as non-type template args"
href="https://bugs.llvm.org/show_bug.cgi?id=37829">37829</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>References to functions as non-type template args
</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>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>zhonghao@pku.org.cn
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Clang++ compiles the following code without any error messages:
#include <utility>
#include <iostream>
using namespace std;
template <typename _T, _T _V>
void foo()
{
cout << __PRETTY_FUNCTION__ << endl;
}
int a = 0;
int b() { cout << __PRETTY_FUNCTION__ << endl; }
int main()
{
foo<int, 9>();
foo<int (), b>();
}
In the contrast, gcc produces the following error message:
‘int()’ is not a valid type for a template non-type parameter foo<int (), b>();
A bug report of gcc (<a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=6030">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=6030</a>)
discusses more details of this issue.
Shall clang also fix the problem?</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>