C++ PATCH for c++/43333 (__is_pod semantics change)
Paolo Carlini
paolo.carlini@oracle.com
Mon Mar 22 20:56:00 GMT 2010
On 03/22/2010 09:29 PM, Jason Merrill wrote:
> The C++0x notion of POD may still get fixed, but for now I'm just
> going to change __is_pod to vary based on C++98 or C++0x mode.
Ah cool, this is the more sophisticated solution we briefly envisaged in
Pittsburgh, great.
I only want to add to it that there is a gotcha vs the uses in the
library: if tr1::is_pod keeps using __is_pod as an implementation
detail, its semantics depends on the -std= switch. In other terms,
pre-existing code using tr1::is_pod and assuming the old c++98
semantics, will get the C++1x semantics if built with -std=c++0x. The
problem is, tr1 still lives on now together with all the C++1x features
and headers. But to be clear, the change is certainly fine with me, it's
conforming to tr1 anyway, certainly improves the backward compatibility
in many important cases and it's not affected by the problems of other
solutions (fwiw, I think EDG does the same, as far as the semantics of
__is_pod is concerned, no idea about the libraries using it...)
Paolo.
More information about the Gcc-patches
mailing list