<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:bastienPenava@gmail.com" title="Bastien Penavayre <bastienPenava@gmail.com>"> <span class="fn">Bastien Penavayre</span></a>
</span> changed
<a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - Function template not instantiated if declared as friend"
href="https://bugs.llvm.org/show_bug.cgi?id=5716">bug 5716</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>bastienPenava@gmail.com
</td>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>RESOLVED
</td>
<td>REOPENED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>FIXED
</td>
<td>---
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - Function template not instantiated if declared as friend"
href="https://bugs.llvm.org/show_bug.cgi?id=5716#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - Function template not instantiated if declared as friend"
href="https://bugs.llvm.org/show_bug.cgi?id=5716">bug 5716</a>
from <span class="vcard"><a class="email" href="mailto:bastienPenava@gmail.com" title="Bastien Penavayre <bastienPenava@gmail.com>"> <span class="fn">Bastien Penavayre</span></a>
</span></b>
<pre>The example given is resolved but there are other cases that aren't,
for instance:
struct flag
{
template<class T>
friend void *init(flag, T);
};
template<class R>
struct writer
{
template<class T>
friend void *init(flag, T) {
return nullptr;
}
};
int main()
{
void *data = init(flag{}, 42);
writer<int> tmp;
//note that if the next line is uncommented the link error disappear:
//sizeof(init(flag{}, 42));
}
produce the error:
undefined reference to `void* init<int>(flag, int)'</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>