<html>
<head>
<base href="http://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 --- - Can't use constexpr function-pointer member as non-type template parameter"
href="http://llvm.org/bugs/show_bug.cgi?id=19182">19182</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Can't use constexpr function-pointer member as non-type template parameter
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.4
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>release blocker
</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>coder0xff+llvm_org_bugs@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>The following code does not compile (though it should, and does using gcc):
////////////////
typedef int (*t)();
template<t ptr>
class A {
public:
static constexpr t a = ptr;
};
int f() { return 0; }
class B : public A<&f> {
};
template<typename u>
class C : public A<u::a> {
};
C<B> dummy;
///////////////
$ clang++ -std=c++11 clang_test.cpp
clang_test.cpp:16:20 error: non-type template argument for template parameter
of pointer type 't' (aka 'int (*)()') must have its address taken
class C : public A<u::a> {
^
This bug occurs in at least 3.3 and 3.4, on OSX and Ubuntu.</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>