home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!tully.cs.berkeley.edu!hilfingr
- From: hilfingr@tully.cs.berkeley.edu (Paul N. Hilfinger)
- Newsgroups: gnu.g++.bug
- Subject: Member function overloading
- Date: 25 Jan 1993 20:29:30 -0500
- Organization: GNUs Not Usenet
- Lines: 24
- Sender: daemon@cis.ohio-state.edu
- Approved: bug-g++@prep.ai.mit.edu
- Distribution: gnu
- Message-ID: <9301240927.AA02697@tully.CS.Berkeley.EDU.iliad>
-
- In at least versions 1.39, 2.2.2, and 2.3.3 of g++/gcc (for the Sun),
- the attached program compiles without comment. My understanding is
- that, on the contrary, the definition of I::f should hide, rather than
- overload, that of H::f, making the calls f() and x.f() illegal.
-
- P. Hilfinger
-
- ---------------------------- cut here ---------------------------
- class H {
- public:
- int f();
- };
-
- class I : public H {
- public:
- int f(double) { return f(); }
- };
-
- int main()
- {
- I x;
- return x.f();
- }
-
-