This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/25427] Impossible to create a friend function for a class in a namespace, outside the namespace.



------- Comment #3 from pinskia at gcc dot gnu dot org  2005-12-15 16:23 -------
This is invalid code, Comeau gives the following error:
"ComeauTest.c", line 12: error: the global scope has no "operator<<"
                        friend std::ostream & :: operator<<(std::ostream &os,A
&a);
                                                 ^
GCC's error could be better.

Anyways the way to fix it would to add the following before the namespace S:
namespace S{class A;}
std::ostream &operator<<(std::ostream &os,S::A &a);


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]