BUG report
holger@2die4.com
holger@2die4.com
Mon Jan 17 09:05:00 GMT 2000
g++ --version: 2.95.1
System: SuSe 6.0 Linux, kernel 2.0.36
called: g++ buecherei.cpp
no CCFLAGS or CCOPTS
In file included from buecherei.cpp:2:
leih.h: In method `Datum::operator char *()':
leih.h:31: Internal compiler error in `emit_block_move', at expr.c:1647
Please submit a full bug report.
See <URL: http://www.gnu.org/software/gcc/faq.html#bugreport > for instructions.
This is file buecherei.cpp:
---------------------------
#include <iostream>
#include "leih.h"
int main() {
Datum d;
cout << (char*) d << endl;
}
This is file leih.cpp:
----------------------
#ifndef _leih_h
#define _leih_h
#include <time.h>
/* Leihobjekte */
class Invalid_Time {
};
class Datum {
public:
Datum() { d = time (0); }
Datum (time_t t) { d = t; }
Datum (int y, int m, int d) {
time_t time_tmp;
tm tm_tmp;
tm_tmp.tm_sec = 0; tm_tmp.tm_min = 0; tm_tmp.tm_hour = 0;
tm_tmp.tm_mday = d;
tm_tmp.tm_mon = m;
tm_tmp.tm_year = y;
time_tmp = mktime (&tm_tmp);
if (int (time_tmp) == -1) throw Invalid_Time();
d = time_tmp;
}
operator char*() {
static char formatted [20];
static tm tm_tmp = localtime (&d);
strftime (formatted, sizeof (formatted),
"%Y-%m-%d", &tm_tmp);
return formatted;
}
private:
time_t d;
};
class leihobjekt {
public:
private:
char Signatur [10];
char Standort [3];
Datum AusleihDatum;
Datum RueckgabeDatum;
};
#endif
-----------------------------------------
Sincerely
Holger Jakobs
---------------------------------------------------
Get free personalized email at http://www.iname.com
More information about the Gcc-bugs
mailing list