Article View: gnu.g++.bug
Article #39G++ 2.3.1 expression evaluation(?) signal 11 bug.
From: Peter Mutsaers
Date: Wed, 04 Nov 1992 17:32
Date: Wed, 04 Nov 1992 17:32
52 lines
1876 bytes
1876 bytes
The following program triggers the bug. This is a stripped down
version of a real program of mine where this occurred. The comments
tell under what conditions the bug does or does not occur. The
problems seems pretty vague to me, but it has something to do with a
combination of references to a class (not a simple type) and using a
copy constructor (for parameter) at the same time.
class String
{
public:
String();
// this function must be present to trigger bug
String(const String& x);
// this function must be present to trigger bug
void operator = (const String& y);
};
class pn_place {
char dist; // must be here to cause bug!
String name; // must be here to cause bug; must be String!
};
class Stringpn_placeAVLMap
{
public:
void bar();
pn_place& foo (String key); // String &key triggers no bug
};
pn_place hh;
String uh;
void Stringpn_placeAVLMap::bar()
{
foo(uh) = hh; // here occurs the bug
// this seems to be a work around
// pn_place &i=foo(uh);
// i=hh;
}
Hope someone can help me. Thanks in advance,
___________________________________________________________________________
Peter Mutsaers muts@fss.fokker.nl |===============================
Fokker Space & Systems |Quod licet bovi, non licet Jovi
Technical Details
Message-ID:
<9211041532.AA05312@fss.fokker.nl>Path:
arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!fss.fokker.NL!mutsShow Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!fss.fokker.NL!muts From: muts@fss.fokker.NL (Peter Mutsaers) Subject: G++ 2.3.1 expression evaluation(?) signal 11 bug. Message-ID: <9211041532.AA05312@fss.fokker.nl> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Wed, 4 Nov 1992 17:32:05 GMT Approved: bug-g++@prep.ai.mit.edu Lines: 53