public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* REPOST: Works with gcc 2.7.2.3 - not with egcs 1.0 or later
@ 1997-12-18 12:29 Marius Kjeldahl
  0 siblings, 0 replies; only message in thread
From: Marius Kjeldahl @ 1997-12-18 12:29 UTC (permalink / raw)
  To: egcs, egcs-bug

The following program will not compile under egcs 1.0 or later, but
will work fine on gcc 2.7.2.3. By applying the latest patch submittet
by Jason Merrill, the error message complaining about the SomeClass_t
constructor will go away. However, the line:

  DynamicOnly_t* ptr = DynamicOnly_t::create ();

will still emit the following error (with Jason Merrill's patch):

test.cpp:26: sorry, not implemented: initializer contains unrecognized
tree code

I have included both the code to demonstrate the bug and Jason
Merrill's patch in this posting.

Anybody?

Thanks in advance..

Marius

---8<---- Sample Code ---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;
}

---8<---- Jason Merrill's patch ---8<----
*** error.c 1997/12/08 00:33:00 1.15
--- error.c 1997/12/16 18:31:18
***************
*** 1534,1539 ****
--- 1534,1545 ----
        OB_PUTS ("{unparsed}");
        break;

+     case TRY_CATCH_EXPR:
+     case WITH_CLEANUP_EXPR:
+     case CLEANUP_POINT_EXPR:
+       dump_expr (TREE_OPERAND (t, 0), nop);
+       break;
+
      case TREE_LIST:
        if (TREE_VALUE (t) && TREE_CODE (TREE_VALUE (t)) == FUNCTION_DECL)
    {


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1997-12-18 12:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-12-18 12:29 REPOST: Works with gcc 2.7.2.3 - not with egcs 1.0 or later Marius Kjeldahl

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).