gcc 2.95.2 problem

Piotr Nestorow Piotr.Nestorow@telelogic.se
Wed Dec 8 04:34:00 GMT 1999


Hi,

On Linux (RedHat 6.1) with g++:

Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)


I get a strange error:

t.cc:10: sorry, not implemented: initializer contains unrecognized tree code
t.cc:10: default argument `C::f' uses local variable ` /* decl error */ '

How can this be fixed? In the code, in the compiler ...

Regards
Piotr Nestorow
Telelogic AB, Sweden
Piotr.Nestorow@telelogic.se


The example t.cc:
-----------------

typedef bool (*fp)(wchar_t);

class C {
public:
  static bool f(wchar_t);
  static bool f(char c);
};

int ff (const C &a,  fp predicate = C::f)
{
 return 2;
}

bool C::f(wchar_t)
{
 return 1;
}

int main(void) {
  C c;
  ff(c);
  return 0;
}


More information about the Gcc mailing list