Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2005-06-03 21:47:48


On Jun 3, 2005, at 1:23 PM, David Abrahams wrote:

> Okay, here's your next challenge. This is with the very latest Comeau
> alpha release compiler.
>
> "c:\boost/boost/type_traits/is_member_function_pointer.hpp", line 67:
> warning #1290-D:
> non-POD class type passed through ellipsis

That's ominous! This is exactly what I was talking about when:

On May 26, 2005, at 9:02 AM, Howard Hinnant wrote:

> I haven't dug into boost::is_pointer, but I'm guessing it involves a
> tentative binding to an ellipsis:
>
> template <class U> static two test(...);
>
> 5.2.2p7 says that binding a non-POD class type to an ellipsis has
> undefined behavior. CodeWarrior's behavior in this context is to try
> to pass the type by value by using the type's copy constructor, which
> in this case is private, and thus triggers the access error.

The scary part is that we do so many useful things these days by
tentatively passing non-POD's past an ellipses, though only at compile
time, never at run time. But the compiler is not making that
distinction.

This is a big problem, and I suspect it will need to be addressed at
the standards level. I don't have a solution yet.

-Howard


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk