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]

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


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