steve@warwick.UUCP (03/15/86)
This is one of a series of reports of bugs found in the C++ compiler here at
warwick. We have release 1.0 of the software.
DESCRIPTION
Cfront seems to get confused between return types and argument types if
you get them wrong. This only seems to happen for operator functions -
normal member functions provoke a correct error message.
EXAMPLE
struct foo {
operator=(foo &); // void return type missing
};
void
foo::operator=(foo &f) // Oops
{
}
main()
{
}
COMPILER OUTPUT
CC foo.c:
"foo.c", line 8: error: bad argument type for foo::operator =()
1 error
--
Steve Rumsby.
...!ukc!warwick!steve.steve@warwick.UUCP (03/15/86)
This is one of a series of reports of bugs found in the C++ compiler here at
warwick. We have release 1.0 of the software.
DESCRIPTION
Cfront seems not to do all the type checking it ought to. The following
code contains an assignment of "pointer to function" to "enum", which
is clearly wrong, as is the generated C.
EXAMPLE
enum x { X_A, X_B};
class foo {
x i;
public:
x baz() {return i;}
};
main()
{
foo f;
x y;
y = (&f)->baz;
}
COMPILER OUTPUT
CC foo.c:
cc foo.i -lC
"foo.c", line 14: _foo_baz undefined
"foo.c", line 14: member of structure or union required
"foo.c", line 14: warning: illegal combination of pointer and integer, op =
--
Steve Rumsby.
...!ukc!warwick!steve.