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]

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); };
};
# for ver in 3.3.6 3.4.6 4.1.1
> do
>         gcc-config i686-pc-linux-gnu-$ver >/dev/null 2>&1
>         source /etc/profile
>         export LANG=C
>         g++ -dumpversion
>         g++ -c s.i -o s.o && echo ";)"
> done 
3.3.6
;)
3.4.6
;)
4.1.1
s.i: In function 'P B(long int)':
s.i:3: error: 'A' was not declared in this scope
# g++ -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /var/tmp/portage/gcc-4.1.1-r1/work/gcc-4.1.1/configure
--prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.1
--includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1/man
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1/info
--with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4
--host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec
--enable-nls --without-included-gettext --with-system-zlib
--disable-checking --disable-werror --disable-libunwind-exceptions
--disable-multilib --disable-libmudflap --disable-libssp
--disable-libgcj --enable-languages=c,c++,fortran --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix gcc version 4.1.1 (Gentoo 4.1.1-r1)

Regards, Bodo


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