BUGREPORT: nested friend methods of a nested class inside a template class

Jason Kim jasonkim@central.cis.upenn.edu
Tue Mar 4 11:19:00 GMT 2003


A templated container class that contains a fully defined nested class
(i.e. iterator) which requires a friend operator causes gcc 3.2.2 to
complain that the defined friend method of the iterator is an abstract
virtual member (!).

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gcc32tst.cc
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20030304/09d2d6da/attachment.cc>
-------------- next part --------------

Note that the example source file compiles successfully with gcc 2.95.3.

Thanks.

-Jason Kim


--
Here is the failed compilation output resulting with gcc 3.2.2

/apps/pkgs/gcc-3.2.2/bin/g++ -c -v gcc32tst.cc
Reading specs from
/apps/pkgs/gcc-3.2.2/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/specs
Configured with: ./configure --prefix=/apps/pkgs/gcc-3.2.2
Thread model: posix
gcc version 3.2.2
 /apps/pkgs/gcc-3.2.2/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/cc1plus -v
-D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=2
-D__GXX_ABI_VERSION=102 -D__ELF__ -Dunix -D__gnu_linux__ -Dlinux
-D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux
-Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_GNU_SOURCE
-Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__
-D__tune_pentiumpro__ gcc32tst.cc -D__GNUG__=3 -D__DEPRECATED
-D__EXCEPTIONS -quiet -dumpbase gcc32tst.cc -version -o /tmp/ccRBNXcE.s
GNU CPP version 3.2.2 (cpplib) (i386 Linux/ELF)
GNU C++ version 3.2.2 (i686-pc-linux-gnu)
    compiled by GNU C version 2.95.3 20010315 (release).
ignoring nonexistent directory
"/apps/pkgs/gcc-3.2.2/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /apps/pkgs/gcc-3.2.2/include/c++/3.2.2
 /apps/pkgs/gcc-3.2.2/include/c++/3.2.2/i686-pc-linux-gnu
 /apps/pkgs/gcc-3.2.2/include/c++/3.2.2/backward
 /usr/local/include
 /apps/pkgs/gcc-3.2.2/include
 /apps/pkgs/gcc-3.2.2/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include
 /usr/include
End of search list.
gcc32tst.cc:33: cannot declare parameter `it' to be of type
`container<T, 
   Y>::const_iter'
gcc32tst.cc:33:   because the following virtual functions are abstract:
gcc32tst.cc:28:	  bool operator==(const container<T, Y>::const_iter&,
const 
   container<T, Y>::const_iter&)

Compilation exited abnormally with code 1 at Tue Mar  4 06:10:11


More information about the Gcc-bugs mailing list