Thread View: net.lang.c++
1 messages
1 total messages
Started by Bjarne Stroustrup
Fri, 19 Sep 1986 00:59
bug in 1.0 compiler
Author: Bjarne Stroustrup
Date: Fri, 19 Sep 1986 00:59
Date: Fri, 19 Sep 1986 00:59
29 lines
1240 bytes
1240 bytes
> Subject: Bug in 1.0 compiler
> Path: ..!rochester!sher (David Sher @ U of Rochester, CS Dept, Rochester, NY)
> This piece of code generates incorrect C code. The fact that
> it is incorrect C++ code is no excuse since it involves a type violation
> that cfront should catch (an (int ()) is not an int). We have not yet
> recieved or installed the 1.1 C++ (I don't know whether we've got it yet).
> The code is thus:
#include <stream.h>
#include <stdio.h>
class foo
{
int cat;
public:
foo( int x , int y ) { cat = x + y; }
const int sile() { return sile; }
};
main()
{
foo x(1,7);
cout << x.sile();
}
Sorry, fixed in 1.1:
"b.c", line 9: error: bad return value type for foo::sile(): const int foo::() ( const int expected)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads