Path: utzoo!attcan!uunet!mcvax!hp4nl!tnosoes!tom From: tom@tnosoes.UUCP (Tom Vijlbrief) Newsgroups: comp.lang.c++ Subject: Is this a compiler bug ? Keywords: G++ Message-ID: <435@tnosoes.UUCP> Date: 26 Jan 89 15:08:34 GMT Organization: TNO Institute for Perception, Soesterberg, The Netherlands Lines: 37 When compiling a file of the OOPS package, G++ (1.32) produced an errormessage for the following function: ========================= void Time::printOn(ostream& strm) { register unsigned hh = hour(); #if 1 ((Date)*this).printOn(strm); // Error ! #else ((Date *)this)->printOn(strm); // No Error ! #endif strm << form(" %d:%02d:%02d ", (hh <= 12) ? hh : hh-12, minute(), second()); if (hh < 12) strm << "am"; else strm << "pm"; } ========================= In function void Time::printOn (struct ostream &): Time.c:258: both constructor and type conversion operator apply =========================== The alternative does not produce an error. Are these two equivalent and is this a compiler bug ? Tom =============================================================================== Tom Vijlbrief TNO Institute for Perception P.O. Box 23 Phone: +31 34 63 62 77 3769 ZG Soesterberg E-mail: tnosoes!tom@mcvax.cwi.nl The Netherlands or: uunet!mcvax!tnosoes!tom ===============================================================================