This is the mail archive of the gcc@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]

egcs971015 ptolemy0.7 more problems


I've gotten a little further, but now I'm stumped.

../../src/kernel/Matrix.cc: In method `ComplexMatrix::ComplexMatrix(int, int, class PortHole &)':
../../src/kernel/Matrix.cc:528: call of overloaded `Complex(Particle &)' is ambiguous
../../src/kernel/ComplexSubset.h:50: candidates are: Complex::Complex(double, double)
../../src/kernel/ComplexSubset.h:51:                 Complex::Complex(const Complex &)
../../src/kernel/Matrix.cc: In method `FixMatrix::FixMatrix(int, int, class PortHole &)':
../../src/kernel/Matrix.cc:922: call of overloaded `Fix(Particle &)' is ambiguous
../../src/kernel/Fix.h:184: candidates are: Fix::Fix(double)
../../src/kernel/Fix.h:200:                 Fix::Fix(const Fix &)

The problem is that Particle has an operator Complex, so there's no
ambiguity here as far as I can see.

I can mail the Matrix.ii to anyone who would be interested, it's about 
25k compressed.

I tried to make a simple test program with the same structure, but it
compiles without error.  Here is the general idea:

class Complex;

class Particle {
public:
  virtual operator Complex () const = 0;
  virtual operator double () const = 0;
};

class Porthole {
public:
  virtual Particle& operator % (int);
};

class Complex {
public:
  Complex (double, double);
  Complex (const Complex&);
};

Complex test (Porthole p) {
  Complex z = Complex (p%2);
  return z;
}


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