public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Bug in egcs?
@ 1997-12-15 12:34 Marius Kjeldahl
  1997-12-15 13:47 ` H.J. Lu
  0 siblings, 1 reply; 11+ messages in thread
From: Marius Kjeldahl @ 1997-12-15 12:34 UTC (permalink / raw)
  To: egcs, egcs-bugs

While porting some code from Visual C++ 5.0 to egcs (I've tried both
1.0 and the 971207 release) I came across a problem compiling some of
the code. I have been able to narrow it down to the 30 lines attached
to this mail. The relevant error message I get while compiling if I
_remove_ the comment from the SomeClass_t constructor is:

test.cpp:13: sorry, not implemented: `try_catch_expr' not supported by
dump_expr

If the constructor is commented out, everything works fine and
dandy. On Microsoft Visual C++ a similar piece of code (which emits
the same error on the same construction under egcs on linux) compiles
and runs without any problems.

Regardless, the error message does not really give me much help in
figuring this one out. Is there anybody out there with a clue?

Thanks in advance..

Marius

-----8< Code snippet follows -----8<-----8<-----8<-----8<-----8<
#include <string.h>

class SomeClass_t {
public:
  //  SomeClass_t () : x (11) {}
protected:
  float x;
};

class DynamicOnly_t {
public:
  static DynamicOnly_t* create (const char* name = "UNDEF",
				const SomeClass_t& somec = *(new SomeClass_t ())) {
    return new DynamicOnly_t (name, somec);
  }
  DynamicOnly_t (const char* name, const SomeClass_t& somec) :
    m_somec (somec) {
    strncpy (m_Name, name, sizeof (m_Name));
  }
private:
  SomeClass_t m_somec;
  char m_Name[255];
};

int main (int argc, char* argv[]) {
  DynamicOnly_t* ptr = DynamicOnly_t::create ();
  return 0;
}

// compiled with 'gcc test.cpp' where gcc = egcs 1.0 and 971207

^ permalink raw reply	[flat|nested] 11+ messages in thread
[parent not found: <52lnxmz6px.fsf.cygnus.egcs@ace.funcom.com>]
* Bug in egcs ?
@ 1998-04-23  6:05 Laurent Deniau
  0 siblings, 0 replies; 11+ messages in thread
From: Laurent Deniau @ 1998-04-23  6:05 UTC (permalink / raw)
  To: egcs

Hello,

egcs doesn't complain on the following code:

template <typename T>
class Object {
public:

  // ...

  Object&
  operator = (Object<T> const& e) {
    const_cast<T>(_e) = e;
    return *this;
  }

private:
  T _e;
};


According to the CD2, we should have write :

const_cast<T&>(_e) = e;

in order to get reference to _e.

with best regards,

[ Deniau Laurent -- Numerical Analysis and Signal Processing ]
[    CERN -- The European Laboratory for Particle Physics    ]
[ Laurent.Deniau@cern.ch -- http://wwwinfo.cern.ch/~ldeniau  ]

^ permalink raw reply	[flat|nested] 11+ messages in thread
[parent not found: <353F3C9D.EDC7B0D8.cygnus.egcs@cern.ch>]

end of thread, other threads:[~1998-04-24  6:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-12-15 12:34 Bug in egcs? Marius Kjeldahl
1997-12-15 13:47 ` H.J. Lu
1997-12-15 13:58   ` H.J. Lu
1997-12-15 16:57   ` Jani Hakala
     [not found] <52lnxmz6px.fsf.cygnus.egcs@ace.funcom.com>
1997-12-15 15:07 ` Jason Merrill
1997-12-16  0:36   ` Marius Kjeldahl
1997-12-16 12:25     ` Jason Merrill
1997-12-16 12:25       ` Marius Kjeldahl
1998-04-23  6:05 Bug in egcs ? Laurent Deniau
     [not found] <353F3C9D.EDC7B0D8.cygnus.egcs@cern.ch>
1998-04-23 21:12 ` Nathan Myers
1998-04-24  6:54   ` Gabriel Dos Reis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).