Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!caip!clyde!burl!ulysses!allegra!alice!bs From: bs@alice.UucP (Bjarne Stroustrup) Newsgroups: net.lang.c++ Subject: bug in 1.0 compiler Message-ID: <6086@alice.uUCp> Date: Thu, 18-Sep-86 20:59:28 EDT Article-I.D.: alice.6086 Posted: Thu Sep 18 20:59:28 1986 Date-Received: Sat, 20-Sep-86 00:34:25 EDT Organization: Bell Labs, Murray Hill Lines: 28 > 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 #include 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)