Thread View: de.comp.lang.c++
1 messages
1 total messages
Started by Bjoern Dosch
Mon, 13 Nov 1995 10:32
Problem mit gcc-2.7.0
Author: 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 --
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads