<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 --- - clang allows forming pointer to function with cv-qualifier-seq or ref-qualifier"
href="http://llvm.org/bugs/show_bug.cgi?id=19742">19742</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang allows forming pointer to function with cv-qualifier-seq or ref-qualifier
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</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>daniel.kruegler@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>When compiling the following code using C++11 options:
-Wall -Wextra -std=c++11 -pedantic
or using C++1y options:
-Wall -Wextra -std=c++1y -pedantic
it is accepted by clang 3.5 trunk 208701 or 3.4 final:
//---------------------
template<class T>
struct add_ptr
{
using type = T*;
};
int main() {
using FC = void () const;
using PFC = add_ptr<FC>::type;
using FLR = void () &;
using PFLR = add_ptr<FLR>::type;
using FRR = void () &&;
using PFRR = add_ptr<FRR>::type;
}
//---------------------
After resolution of CWG 1417,
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1417">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1417</a>
the formation of a pointer to function types with cv-qualifier or ref-qualifier
(even in template context) is not supported. In non-template context, clang
already rejects such an attempt.
The code had been compiled using the online-compiler
<a href="http://melpon.org/wandbox/">http://melpon.org/wandbox/</a>
therefore the provided information about OS and hardware are guesses on my
side.</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>