Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!iuvax!pur-ee!uiucdcs!uiucdcsb!kenny From: kenny@uiucdcsb.UUCP Newsgroups: comp.lang.c++ Subject: C++ compiler bug? Message-ID: <165700010@uiucdcsb> Date: Thu, 1-Oct-87 01:55:00 EDT Article-I.D.: uiucdcsb.165700010 Posted: Thu Oct 1 01:55:00 1987 Date-Received: Sat, 3-Oct-87 01:29:36 EDT Lines: 52 Nf-ID: #N:uiucdcsb:165700010:000:1620 Nf-From: uiucdcsb.cs.uiuc.edu!kenny Oct 1 00:55:00 1987 HELP! I'm at wit's end with the following problem; I can't even find a workaround (it seems that any way I spell it, the problem stays). Consider the following (highly stripped-down) program: ------------------------------------------------------------------------ 1 #include 2 3 struct alpha { 4 alpha () { } 5 operator double () { return 0.0; } 6 }; 7 istream & operator >> (istream &, alpha &); 8 9 struct beta { 10 }; 11 12 class gamma : public beta { 13 public: 14 void gamma_entry (alpha &, beta &); 15 }; 16 17 main () { 18 alpha a; 19 beta b; 20 gamma g; 21 g.gamma_entry (a, b); 22 cin >> a; 23 g.gamma_entry (a, b); 24 } ------------------------------------------------------------------------ An attempt to compile, on either 1.1 or 1.2, results in: ------------------------------------------------------------------------ %CC -c bug.c CC bug.c: "bug.c", line 23: error: ambiguous operand types void gamma::(alpha &, beta &) beta for function call "bug.c", line 24: warning: g used but not set 1 error ------------------------------------------------------------------------ Removing either the ``cin >> a'' at line 22 or the ``operator double'' declaration at line 5 seems to get rid of the problem. What's the compiler complaining about, and how can I get around it? I can't even make sense of the error message! Kevin Kenny UUCP: {ihnp4,pur-ee,convex}!uiucdcs!kenny Department of Computer Science ARPA: kenny@B.CS.UIUC.EDU (kenny@UIUC.ARPA) University of Illinois CSNET: kenny@UIUC.CSNET 1304 W. Springfield Ave. Urbana, Illinois, 61801 Voice: (217) 333-8740