🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #858

redefinition of method of templated class causes core-dump

#858
From: rtm
Date: Mon, 31 Aug 1992 19:13
49 lines
1742 bytes
I'm running g++ 2.2.2 on a SPARCstation ELC under SunOS 4.1.2.
The following C++ code, which redefines a method of a templated
class, causes cc1plus to get signal 11:

template<class T> class a{
public:
    void foo(int);
private:
    T v;
};

template<class T> void
a<T>::foo(int x)
{
}

template<class T> void
a<T>::foo(int x)
{
}

main()
{
    a<int> zz;

    zz.foo(99);
}

The above file is twice.cc. When I run
g++ -v twice.cc
here's what it says:

Reading specs from /home/glan/lib/gcc-lib/sun4/2.2.2/specs
gcc version 2.2.2
 /home/glan/lib/gcc-lib/sun4/2.2.2/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG
__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__spa
rc -D__sun -D__unix twice.cc /usr/tmp/cca02423.i
GNU CPP version 2.2.2 (sparc)
 /home/glan/lib/gcc-lib/sun4/2.2.2/cc1plus /usr/tmp/cca02423.i -quiet -dumpbase
twice.cc -version -o /usr/tmp/cca02423.s
GNU C++ version 2.2.2 (sparc) compiled by GNU C version 2.2.2.
/home/glan/bin/gcc: Internal compiler error: program cc1plus got fatal signal 11

I didn't compile cc1plus with debugging turned on, so the backtrace
from the core file isn't very interesting. But here it is anyway:
#0  0x24498 in start_function ()
#1  0xe7bc in yyparse ()
#2  0x7c4e0 in output_file_directive ()
#3  0x7f0a4 in main ()
Technical Details
Message-ID: <9208311913.AA02434@virtual7.harvard.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!das.harvard.edu!rtm

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!das.harvard.edu!rtm
From: rtm@das.harvard.edu
Subject: redefinition of method of templated class causes core-dump
Message-ID: <9208311913.AA02434@virtual7.harvard.edu>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Mon, 31 Aug 1992 19:13:19 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 50