This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Class-through-ellipsis warning


Ross Smith wrote:

> Is there any way (besides -w) of turning off the "cannot pass objects of
> type `<class>' through `...'" warning?

Currently, no. Some time ago I wrote the patch to suppress this
warning if the function taking ... was marked __attribute__(unused),
but later I realized that unused was not designed for things like this,
so I did not submit the patch. Now I think that the better way to 
do this is to suppress the warning somehow when the function is 
called from inside sizeof. (Not that I know how it can be done, 
but if there will be sufficient interest, and no one more qualified
than me will step in, I will look into it).

> (If you're wondering why I want to do that, see section 2.7 of Andrei
> Alexandrescu's _Modern C++ Design_.)
> 

If I understand correcty, this is about determining at comple time
whether there is implicit conversion between arbitrary types, right?
There was Andrei's article on the topic somewhere on the C++ Report 
web site.

Best regards,
Artem.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]