Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!watdragon!violet!gjditchfield From: gjditchfield@violet.UUCP Newsgroups: comp.lang.c++ Subject: bug? Message-ID: <3849@watdragon.waterloo.edu> Date: Mon, 19-Oct-87 14:04:04 EDT Article-I.D.: watdrago.3849 Posted: Mon Oct 19 14:04:04 1987 Date-Received: Tue, 20-Oct-87 03:14:32 EDT Sender: daemon@watdragon.waterloo.edu Distribution: comp Lines: 29 Keywords: inline local variables A copy of the error message is included in the comments after class b. Note that the errors are produced by the C compiler, not C++. The error messages disappear if val is moved out of the class, or if one of the calls to val is removed from main's print statement. -------------------------------------- #include class b { friend int val(b& bv, int iv) { // line 3 int t = bv.i; bv.i = iv; return t; }; int i; }; //ccc ft.cc: //cc ft..c /usr/lib/libccc.a //"ft.cc", line 3: redeclaration of "_au2__Xt_val_global" main() { b bozo; int temp = val(bozo, 3); cout << val(bozo, 4) << val(bozo, 5); } -- Glen Ditchfield {watmath,utzoo,ihnp4}!watrose!gjditchfield Dept of Computer Science, U of Waterloo (519) 885-1211 x6658 Waterloo, Ontario, Canada Office: MC 2006 If you grab the bull by the horns, you at least confuse him -- R.A.Heinlein