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]

Internal compiler error on typeof()


The following code produces an internal compiler error:

template <class T1>
typeof((*(int *)0)) total(const T1 & t1)
{
}

g++ -v bug.cc
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -Asystem(unix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ bug.cc /tmp/ccbsFjLc.ii
GNU CPP version egcs-2.91.57 19980901 (egcs-1.1 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/qt/include
 /usr/local/qt/include
 /usr/local/include/g++
 /usr/local/include
 /usr/local/i686-pc-linux-gnulibc1/include
 /usr/local/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/cc1plus /tmp/ccbsFjLc.ii -quiet -dumpbase bug.cc -version -o /tmp/ccWpU7nk.s
GNU C++ version egcs-2.91.57 19980901 (egcs-1.1 release) (i686-pc-linux-gnulibc1) compiled by GNU C version egcs-2.91.57 19980901 (egcs-1.1 release).
bug.cc:2: Internal compiler error.
bug.cc:2: Please submit a full bug report to `egcs-bugs@cygnus.com'.
 

My machine is:

jdharper:~# uname -a
Linux jdharper 2.0.34 #12 Thu Nov 19 15:20:06 EST 1998 i686 unknown

The ANSI X3J16 committee made it clear that typeof() will not be a standard language feature.  I wonder if the EGCS group is interested in maintaining typeof() in the GNU C++ compiler?

I apologize if an answer to this question is published somewhere.  I looked in "EGCS FAQ" and  "Frequently reported bugs of the EGCS C++ compiler" and couldn't find any mention of typeof().


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