[Bug c++/11030] Cannot befriend a template specialization

giovannibajo at libero dot it gcc-bugzilla@gcc.gnu.org
Sun Jun 22 21:03:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11030


giovannibajo at libero dot it changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gdr at integrable-solutions
                   |                            |dot net


------- Additional Comments From giovannibajo at libero dot it  2003-06-22 21:03 -------
Gaby,

§14.5.3/1: "A friend of a class or class template can be [...] a specialization 
of a function template or class template, [...]". 

I think that the code is valid, even though I see that it actually gives a lot 
of problems to the compiler, because it has to realize that the function 
friendship is type-dependent (on the template parameter of A, since it matches 
one of its specializations), so the access control should be postponed till A's 
instantiation (due to two-stage name lookup).



More information about the Gcc-bugs mailing list