[Bug c++/14281] New: Regression in v3.4: friend class not working

s_gccbugzilla at nedprod dot com gcc-bugzilla@gcc.gnu.org
Wed Feb 25 00:52:00 GMT 2004


With GCC v3.4 CVS 20040218 it thinks that ImplBase (typedefed within its parent) 
is private which it is - but the class which inherits off of it via template 
parameter is a friend.

I understand that friendship may not apply to base classes as it's not 
technically "in" the class yet. However my outdated version of the standard 
isn't clear here so I have no real way of knowing except that MSVC and GCC v3.2 
compile this fine.

g++ -fPIC -Wformat -Wno-reorder -Wno-non-virtual-dtor -march=i486 
-mcpu=athlon-xp -fexceptions -fkeep-inline-functions -g -DFOXDLL -DUSE_POSIX 
-DHAVE_CONSTTEMPORARIES -D_DEBUG -DHAVE_XSHM_H -DHAVE_XCURSOR_H=1 -DHAVE_XFT_H=1 
-DXTHREADS=1 -DFOX_THREAD_SAFE=1 -DHAVE_LIBDL=1 -DHAVE_CUPS_H=1 -DSTDC_HEADERS=1 
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 
-DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 
-DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_SYS_WAIT_H=1 
-DHAVE_DIRENT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_SELECT_H=1 
-DBUILDING_TCOMMON -DFOXDLL_EXPORTS -DHAVE_JPEG_H -DHAVE_PNG_H -DHAVE_TIFF_H 
-DHAVE_ZLIB_H -DHAVE_OPENSSL -DHAVE_GL_H -DSUN_OGL_NO_VERTEX_MACROS 
-DHPOGL_SUPPRESS_FAST_API -DHAVE_GLU_H -ITnFOX/include -I/usr/kerberos/include 
-I/usr/X11R6/include -I/usr/include/freetype2 -Iinclude -c -o 
objs/Debug/TFileBySyncDev.os src/TFileBySyncDev.cxx
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
src/TFileBySyncDev.cxx: In member function `FX::FXIPCChannel::HandledCode Tn::
TFileBySyncDevPrivate::msgReceived(FX::FXIPCMsg*)':
src/TFileBySyncDev.cxx:260: warning: converting of negative value `-0x000000001' 
to `unsigned int'
TnFOX/include/FXGenericTools.h: At global scope:
TnFOX/include/FXGenericTools.h: In instantiation of `FX::Generic::FunctorHelper:
:ImplMemFn<FX::Generic::Functor<FX::Generic::TL::item<FX::FXIPCChannel::
HandledCode, FX::Generic::TL::item<FX::FXIPCMsg*, FX::Generic::NullType> > >, 
Tn::TFileBySyncDevPrivate, FX::FXIPCChannel::HandledCode (Tn::
TFileBySyncDevPrivate::*)(FX::FXIPCMsg*)>':
TnFOX/include/FXGenericTools.h:1259:   instantiated from `FX::Generic::
Functor<parslist>::Functor(obj*, fn) [with obj = Tn::TFileBySyncDevPrivate, fn = 
FX::FXIPCChannel::HandledCode (Tn::TFileBySyncDevPrivate::*)(FX::FXIPCMsg*), 
parslist = FX::Generic::TL::item<FX::FXIPCChannel::HandledCode, FX::Generic::TL:
:item<FX::FXIPCMsg*, FX::Generic::NullType> >]'
src/TFileBySyncDev.cxx:297:   instantiated from here
TnFOX/include/FXGenericTools.h:1240: error: `typedef struct FX::Generic::
FunctorHelper::ImplBaseOp<FX::Generic::TL::item<FX::FXIPCChannel::HandledCode, 
FX::Generic::TL::item<FX::FXIPCMsg*, FX::Generic::NullType> >, 1> FX::Generic::
Functor<FX::Generic::TL::item<FX::FXIPCChannel::HandledCode, FX::Generic::TL::
item<FX::FXIPCMsg*, FX::Generic::NullType> > >::ImplBase' is private
TnFOX/include/FXGenericTools.h:1195: error: within this context
scons: *** [objs/Debug/TFileBySyncDev.os] Error 1

Cheers,
Niall

-- 
           Summary: Regression in v3.4: friend class not working
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: s_gccbugzilla at nedprod dot com
                CC: gcc-bugs at gcc dot gnu dot org


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



More information about the Gcc-bugs mailing list