This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: REGRESSION: friend function declared in class not visible in same class scope.
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: bothie at gmx dot de (Bodo Thiesen)
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 21 Nov 2006 20:56:27 -0500 (EST)
- Subject: Re: REGRESSION: friend function declared in class not visible in same class scope.
>
> >> REGRESSION: friend function declared in class not visible in same class scope.
>
> # cat s.i
> class P {
> friend P A(long);
> friend P B(long c) { return A(c); };
> };
This is not a bug as friends don't inject into the namespace according to the
C++ standard, you can work around the problem by using the option -ffriend-injection.
-- Pinski