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]

REPOST: Works with gcc 2.7.2.3 - not with egcs 1.0 or later


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




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