This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
g++ bug? (Internal compiler error)
- To: gcc-bugs at gcc dot gnu dot org
- Subject: g++ bug? (Internal compiler error)
- From: Marc Guiot du Doignon <guiot at nmu dot alcatel dot fr>
- Date: Wed, 29 Mar 2000 14:21:02 +0200
Hi,
The program below gives an error with g++ 2.95.2 and newer. (not with
aCC 1.21)
I also try it with the online compilation.
$ cat testGcc.cc
template <class T, void (T::*FOO)()>
class info
{
public :
info(){}
void operator()(T* t)
{
(t->*FOO)();
}
};
class toto
{
public :
virtual void foo() = 0;
info<toto, &toto::foo> inf;
};
without virtual it work well.
$ gcc -v --save-temps -c testGcc.cc
Reading specs from
/udir/guiot/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.96/specs
gcc version 2.96 20000221 (experimental)
/udir/guiot/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.96/cpp -lang-c++ -v
-D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=96 -D__GNUC_PATCHLEVEL__=0
-D__cplusplus -Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux
-Dunix -D__hppa__ -D__hp9000s800__ -D__hp9000s800 -D__hp9k8__ -D__PWB__
-D__hpux__ -D__unix__ -D__hppa -D__hp9000s800 -D__hp9k8 -D__PWB -D__hpux
-D__unix -Asystem(unix) -Asystem(hpux) -Acpu(hppa) -Amachine(hppa)
-D__EXCEPTIONS -D__hp9000s700 -D_PA_RISC1_1 -D_HPUX_SOURCE
-D_HIUX_SOURCE -D__STDC_EXT__ testGcc.cc testGcc.ii
GNU CPP version 2.96 20000221 (experimental) (cpplib)
(hppa)
#include "..." search starts here:
#include <...> search starts here:
/udir/guiot/include/g++-3
/udir/guiot/include
/udir/guiot/hppa1.1-hp-hpux10.20/include
/udir/guiot/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.96/include
/usr/include
End of search list.
/udir/guiot/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.96/cc1plus testGcc.ii
-quiet -dumpbase testGcc.cc -version -o testGcc.s
GNU C++ version 2.96 20000221 (experimental) (hppa1.1-hp-hpux10.20)
compiled by GNU C version 2.96 20000214 (experimental).
testGcc.cc:16: Internal compiler error.
testGcc.cc:16: Please submit a full bug report.
testGcc.cc:16: See <URL:http://www.gnu.org/software/gcc/bugs.html> for
testGcc.cc:16: instructions.
# 1 "testGcc.cc"
template <class T, void (T::*FOO)()>
class info
{
public :
info(){}
void operator()(T* t)
{
(t->*FOO)();
}
};
class toto
{
public :
virtual void foo() = 0;
info<toto, &toto::foo> inf;
};
.LEVEL 1.1
.SPACE $PRIVATE$
.SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31
.SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82
.SPACE $TEXT$
.SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44
.SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
.IMPORT $global$,DATA
.IMPORT $$dyncall,MILLICODE
gcc2_compiled.:
.IMPORT foo__4toto,CODE