Static/member overloading bug in egcs-1.1 pre-release (2.91.56)

Martin Dorey WVdevmt-WS mdorey@dev.madge.com
Fri Sep 4 02:55:00 GMT 1998


//
// Demonstrates a problem with overloading of static and member functions,
// where the below version of egcs has behaviour which incorrectly depends
// on the order of declaration.
//
// This differs from previous versions of egcs/gcc.
//
// Reading specs from /usr/lib/gcc-lib/i486-linux/egcs-2.91.56/specs
// gcc version egcs-2.91.56 19980829 (egcs-1.1 pre-release)
//

void Call (int (*) (long))
  {}

struct X
{
  static int f (long);
  int f (int);

  int g (int);
  static int g (long);

  void monk ()
  {
    Call (&g); // OK.
    Call (&X::g); // OK.
    Call (&X::f); // OK.
    Call (&f); // Error.
  }
};

-- 




More information about the Gcc-bugs mailing list