This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15625] [3.4/3.5 Regression] friend defined inside a template fails to find static function
- From: "mmitchel at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 May 2004 18:34:40 -0000
- Subject: [Bug c++/15625] [3.4/3.5 Regression] friend defined inside a template fails to find static function
- References: <20040524013452.15625.igodard@pacbell.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From mmitchel at gcc dot gnu dot org 2004-05-31 18:34 -------
This code is invalid; according to the standard, the friend function should not
be injected into the namespace scope. (This is a change from the ARM.)
However, g++ has always done the injection, and we have not yet removed that
functionality, so this code should work as expected.
The standard-conforming way of doing this is to have a namespace-scope
declaration of the function. You can still define it in the class, but it
should be declared outside the class.
This comment is meant to answer Wolfgang's question regarding this seems to work
at all.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15625