🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

g++ bug

#1063
From: Joe Berrios
Date: Wed, 14 Oct 1992 15:26
49 lines
1256 bytes
#include <iostream.h>
 
const int BOS = -1;
 
template <class T>
class data {
    T* dt;
    int top, size;
public:
    data(int sz);
    void push(T value)  { dt[++top] = value; }
};
 
template <class T>
class stack : data<T> {
public:
    stack(int sz) : data<T>(sz) { }
    void push(T value)  { void data<T>::push(value); }
};
 
template <class T>
data<T>::data(int sz)
{
    dt = new T[sz];
    top = BOS;
    size = sz;
}
 
main()
{
stack<int> a(8);
for(int i = 0; i < 5; i++);
   a.push(i);
}

Dear Sirs,
When I try to compile this program using gcc2.2.2, I get the following 
message:
 
hera 88: g++ bs3.C
bs3.C: In method `void  stack<int>::push (int)':
bs3.C:21: internal compiler error 15, please report

Thanks for your prompt reply.

Joseph    


----- End Included Message -----
Technical Details
Message-ID: <9210141526.AA05132@phebos.aps.anl.gov>
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!phebos.aps.anl.gov!berrios

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!phebos.aps.anl.gov!berrios
From: berrios@phebos.aps.anl.gov (Joe Berrios)
Subject: g++ bug
Message-ID: <9210141526.AA05132@phebos.aps.anl.gov>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 14 Oct 1992 15:26:19 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 51