<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - clang -fms-extensions considers an unqualified friend decl to be a forward decl in the enclosing namespace"
href="http://llvm.org/bugs/show_bug.cgi?id=16032">bug 16032</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;">Status</td>
<td>NEW
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>richard-llvm@metafoo.co.uk
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>FIXED
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - clang -fms-extensions considers an unqualified friend decl to be a forward decl in the enclosing namespace"
href="http://llvm.org/bugs/show_bug.cgi?id=16032#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - clang -fms-extensions considers an unqualified friend decl to be a forward decl in the enclosing namespace"
href="http://llvm.org/bugs/show_bug.cgi?id=16032">bug 16032</a>
from <span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span></b>
<pre>Obligatory standard quotes:
7.3.1.2/3:
"If the name in a friend declaration is neither qualified nor a template-id and
the declaration is a function or an elaborated-type-specifier, the lookup to
determine whether the entity has been previously declared shall not consider
any scopes outside the innermost enclosing namespace."
So the friend declaration does not find views::Widget, and the
elaborated-type-specifier is instead the first declaration of an entity. Then
(same paragraph):
"If a friend declaration in a non-local class first declares a class [...] the
friend is a member of the innermost enclosing namespace. The friend declaration
does not by itself make the name visible to unqualified lookup (3.4.1) or
qualified lookup (3.4.3)."
So the friend declares views::internal::Widget, but does not make it visible to
name lookup.
The problem here was that under -fms-extensions, we'd make the injected friend
name visible. The actual MS behavior seems to be more subtle than that; our new
behavior is that we make the injected friend visible unless friend lookup would
find something outside the innermost enclosing namespace.
FWIW, this is still broken in a couple of ways:
* our -fms-extensions behavior here is not a conforming extension
* presumably with the MS compatibility hack enabled, we should befriend
views::Widget, not views::internal::Widget
Anyway, the original bug here is fixed.</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>