http://llvm.org/bugs/show_bug.cgi?id=19631
Richard Smith <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution|--- |INVALID --- Comment #6 from Richard Smith <[email protected]> --- (In reply to comment #2) > (In reply to comment #1) > > 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. 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... > 1. "An explicit specialization shall be declared in a namespace enclosing > the specialized template." > > This is what `clang` is violating. [cut to corrected example] > 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` *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". -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ LLVMbugs mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs
