C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: Is using ... with virtual functions legal?

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
jmueto
Guest





PostPosted: Fri Dec 17, 2004 4:09 pm    Post subject: Re: Is using ... with virtual functions legal? Reply with quote



Reed Hedges wrote:
Quote:
I have a virtual method which uses ... for variable arguments, but
compiling with GCC 3.2 produces this error:

localsite.cc:684: generic thunk code fails for method `virtual
VOS::MetaObject*
VOS::LocalSite::createMetaObject(const char*, const char*, ...)'
which uses
`...'

The code compiles and works fine with GCC 2.95.

if you have a virtual function with an open parameter list (...)
you must not derive virtual.
(just solved the same problem)

Jmueto


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
richard@ex-parrot.com
Guest





PostPosted: Fri Dec 17, 2004 7:10 pm    Post subject: Re: Is using ... with virtual functions legal? Reply with quote



jmueto wrote:
Quote:
Reed Hedges wrote:
I have a virtual method which uses ... for variable arguments, but
compiling with GCC 3.2 produces this error:

localsite.cc:684: generic thunk code fails for method `virtual
VOS::MetaObject*
VOS::LocalSite::createMetaObject(const char*, const char*, ...)'
which uses
`...'

The code compiles and works fine with GCC 2.95.

if you have a virtual function with an open parameter list (...)
you must not derive virtual.
(just solved the same problem)

Not true. Virtual functions are allowed to be variadic. The following
example is perfectly legal.
class C {
virtual void f(...) = 0;
};


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.