home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / gnu / g / bug / 2322 < prev    next >
Encoding:
Text File  |  1993-01-25  |  960 b   |  37 lines

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!tully.cs.berkeley.edu!hilfingr
  2. From: hilfingr@tully.cs.berkeley.edu (Paul N. Hilfinger)
  3. Newsgroups: gnu.g++.bug
  4. Subject: Member function overloading
  5. Date: 25 Jan 1993 20:29:30 -0500
  6. Organization: GNUs Not Usenet
  7. Lines: 24
  8. Sender: daemon@cis.ohio-state.edu
  9. Approved: bug-g++@prep.ai.mit.edu
  10. Distribution: gnu
  11. Message-ID: <9301240927.AA02697@tully.CS.Berkeley.EDU.iliad>
  12.  
  13. In at least versions 1.39, 2.2.2, and 2.3.3 of g++/gcc (for the Sun),
  14. the attached program compiles without comment.  My understanding is
  15. that, on the contrary, the definition of I::f should hide, rather than
  16. overload, that of H::f, making the calls f() and x.f() illegal.
  17.  
  18. P. Hilfinger
  19.  
  20. ---------------------------- cut here ---------------------------
  21. class H {
  22. public:
  23.     int f();
  24. };
  25.  
  26. class I : public H {
  27. public:
  28.     int f(double) { return f(); }
  29. };
  30.  
  31. int main()
  32. {
  33.     I x;
  34.     return x.f();
  35. }
  36.  
  37.