This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

BUG report


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]