>>>>> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:

Lars> Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes: |
Lars> Lars, | | cxx does not like at all your latest changes. Is it
Lars> really supposed to | accept them?

Lars> A conforming C++ compiler are not supposed to take return types
Lars> into account when doing virtual overloading.

Huh? In any case, neither gcc 2.8.1 not dec cxx accept your code (they
are both crap, I know...). Could you point me at the section of the
standard were this is discussed? 

Concerning your example, I simply do not see how it could be
implemented. Consider the following version:

class Foo {
public:
virtual int bar() { return 10; }
 };

class Bar : public Foo {
public:
string bar() { return "ten"; }
 };

void baz(int i) {}

void baz(string s) {}

int main() {
        Foo *foo = new bar;
        baz(foo->bar()); //What code should be generated here???
        return 0;
}


I can understand the case where the return type is changed to a
subclass of a class, but not chnaging int to string...

Lars> If cxx does not support this it is further form conforming than
Lars> I thought.

Lars> Still what is strange about these errors is that we have taken
Lars> advantage of this earlier for insets too, but now cxx flags
Lars> these as errors... I am wondering if it is something I forgot to
Lars> change...

Might be.

JMarc

Reply via email to