<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 INVALID - explicit specialization outside of template's namespace inaccuretly accepted"
href="http://llvm.org/bugs/show_bug.cgi?id=19631">bug 19631</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>REOPENED
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>INVALID
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - explicit specialization outside of template's namespace inaccuretly accepted"
href="http://llvm.org/bugs/show_bug.cgi?id=19631#c6">Comment # 6</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - explicit specialization outside of template's namespace inaccuretly accepted"
href="http://llvm.org/bugs/show_bug.cgi?id=19631">bug 19631</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>(In reply to <a href="show_bug.cgi?id=19631#c2">comment #2</a>)
<span class="quote">> (In reply to <a href="show_bug.cgi?id=19631#c1">comment #1</a>)
> > Your quote from the standard shows that Clang is correct to accept this. The
> > specialization is in a namespace enclosing N. Since it's got a qualified
> > name, the second restriction does not apply.
>
> You are reading it wrong, if we divide it sentence by sentence.</span >
As the editor of the C++ standard, I generally like to think I know how to read
it. But maybe you're right. Let's see...
<span class="quote">> 1. "An explicit specialization shall be declared in a namespace enclosing
> the specialized template."
>
> This is what `clang` is violating.</span >
[cut to corrected example]
<span class="quote">> namespace N {
> template<class> struct A { };
> template<class> struct B { };
>
> template<> struct A<int>;
> }
>
> template<> struct N::A<int> { }; // legal
> template<> struct N::B<int> { }; // illegal, no declaration in the
> // enclosing namespace of `N::A`</span >
*This* declaration is an *a* namespace enclosing the specialized template. The
global namespace encloses it. See the definition of "enclosing namespaces" in
7.3.1/6; see also 7.3/2 if you don't believe that the global scope is a
namespace.
Also note that the rule says "declared in a namespace enclosing" not "declared
in the innermost enclosing namespace".</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>