This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: default parameters, virtual functions
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Nathan Holladay <Nathan dot Holladay at UTSouthwestern dot edu>
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 16 Jul 2003 17:33:36 +0100
- Subject: Re: default parameters, virtual functions
- Organization: Codesourcery LLC
- References: <sf153448.034@mednet.swmed.edu>
Nathan Holladay wrote:
I couldn't access bugzilla, because the password reset page I was emailed was giving errors.
I'm not sure if this is a bug (don't have the standard), but it's short:
When a virtual function is called by another member function of the base class, it uses the base class's default parameters, while calling the derived class's actual function. On the other hand, it behaves as expected (i.e., the derived class's default parameters are used), when accessed externally.
it is behaving correctly in both cases. Th edefault args are used from the declaration
that was visible at the call site.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
The voices in my head said this was stupid too
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk