Article View: de.comp.lang.c++
Article #785Problem mit gcc-2.7.0
From: Bjoern Dosch
Date: Mon, 13 Nov 1995 10:32
Date: Mon, 13 Nov 1995 10:32
61 lines
1925 bytes
1925 bytes
Hallo!
Ich habe hier wieder mal ein Problem mit dem gcc 2.7.0 (unter Solaris
2.2). Folgendes Programm stuerzt klaeglich ab:
1 template<class T> struct X
2 {
3 public:
4 X () : n (0) { }
5
6 X (const X &x)
7 { n = x.n; }
8
9 class Error { };
10
11 int g (void) const
12 { throw Error (); }
13
14
15 friend X<T> f (const X<T> &x1, const X<T> &x2)
16 {
17 X<T> y;
18
19 try { x2.g (); }
20 catch (X<T>::Error) { }
21
22 return y;
23 }
24
25 private:
26 unsigned n;
27 };
28
29 main ()
30 {
31 X<char> x1, x2;
32 f (x1, x2);
33 }
Mein Debugger sagt:
Program terminated with signal 11, Segmentation fault.
#0 0x10f34 in X<char>::X (this=0x10d70, x=@0xeffff8d8) at test.cc:7
#1 0x10d88 in f (x1=@0xeffff960, x2=@0xeffff958) at test.cc:22
#2 0x10c9c in main () at test.cc:32
Ich kann mir nun aber gar keinen Grund vorstellen, warum das passieren
sollte, ausser einem Fehler im gcc. Meiner Meinung nach liegt es am
Exception-Handling. Meine Fragen:
- Hat jemand schon mal sowas beobachtet?
- Ist das vielleicht ein bekannter Fehler des gcc-2.7.0?
- Wann kommt der gcc-2.7.1? ;-)
Ciao
--
BjΓΆrn Dosch
Usenet: bjd@charon.tauber.netz.sub.de
-- PGP Public Key Available --
Technical Details
Message-ID:
<4876s2$5on@neuromancer.charon.incubus.sub.org>Path:
arc1-ca.pugleaf.net!charon.incubus.sub.org!not-for-mailShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!charon.incubus.sub.org!not-for-mail From: bjd@charon.incubus.sub.org (Bjoern Dosch) Newsgroups: de.comp.lang.c++,de.comp.gnu Subject: Problem mit gcc-2.7.0 Date: 13 Nov 1995 11:32:34 +0100 Organization: Charon Inc. Message-ID: <4876s2$5on@neuromancer.charon.incubus.sub.org> NNTP-Posting-Host: neuromancer.charon.incubus.sub.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Newsreader: TIN [version 1.2 PL2]