
John Maddock wrote:
Update: `__is_pod` and `__is_empty` can be safely used with libc++.
A patch attached (against trunk). All the tests run fine.
OK I'm curious - why would a compiler intrinsic work when used with one std lib, not not when used with another?
Here is the details: libstdc++ (of gcc-4.2) defines `struct __is_pod` in some header file. To deal with this, clang disables __is_pod intrinsics when finding `struct __is_pod`; then, __is_pod is not treated as keyword and it becomes just an identifier. However, even in this case, old clang sets __has_feature(is_pod) to 1. So we cannot rely on `#if __has_feature(is_pod)` to check the availability of __is_pod intrinsics. libc++ does not define `struct __is_pod`, so we can safely check the availability of __is_pod intrinsics by `#if __has_feature(is_pod)`. Ditto for __is_empty. Regards, Michel