<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 - instantiating a friend member specialization declaration does not look up member specialization properly"
href="https://bugs.llvm.org/show_bug.cgi?id=38883">38883</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>instantiating a friend member specialization declaration does not look up member specialization properly
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>5.0
</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>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>richard-llvm@metafoo.co.uk
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Clang rejects this valid code with an access violation error:
struct A { template<typename T> static int g0(T x) { return x.n; } };
template<typename T> class B { friend int A::g0<>(B<T>); int n; };
int k = A().g0(B<int>());
The problem is that in the instantiation B<int>, the friend declaration points
nowhere (and does not identify the A::g0<B<int>> specialization that it
should). Despite the friend declaration not being matched to any function, no
diagnostic is issued, and the result is the friend declaration is silently
ignored.</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>