[cfe-commits] [cfe-dev] [PATCH] Libc++ Windows fixes

Howard Hinnant hhinnant at apple.com
Fri Dec 2 09:30:46 PST 2011


Was this intended to be a patch for libc++?  It looks like maybe the wrong patch file got attached.

Howard

On Nov 27, 2011, at 9:28 AM, Ruben Van Boxem wrote:

> Hi,
> 
> I've been cracking at it again, and came up with the attached patch to
> let libc++ play nice with MSVC (or is it the other way around?).
> 
> I created a new __config macro: _LIBCPP_HAS_BROKEN_DECLTYPE, which is
> defined for MSVC, and disables any functionality dependent on the
> functionality broken in MSVC 10 (and probably 11). This is all the
> __is_constructible stuff, and unfortunately this leads to other places
> this macro pops up.
> 
> The good news: I've gotten through <type_traits>, adding the _MSC_VER
> checks alongside the already existing Clang and GCC checks. Perhaps a
> better way to handle this would be two new config macros:
> _LIBCPP_HAS_NOTHROW_INTRINSICS and _LIBCPP_HAS_TRIVIAL_INTRINSICS (not
> *_TYPE_TRAITS, as that's confusing, the type_traits stuff will always
> be present). I can fix that if that sounds sensible. The
> __is_standard_layout and __is_trivial are really just MSVC's __is_pod,
> I don't know how conformant this will be untill I am able to run the
> tests.
> 
> The bad news: I've run into another language incompatibility, namely
> MSVC not allowing template function default template-arguments. I've
> looked in C++03 and my C++11 FDIS, and there's indeed a difference,
> and it is allowed in C++11 as far as I can see. But of course MSVC
> doesn't allow it. I believe I can disable the error (which seems to be
> a warning emitted by default as an error:
> http://msdn.microsoft.com/en-us/library/190h9wbh(v=VS.100).aspx), but
> I'm not sure if it'll have the wanted behavior (the default argument
> will be ignored).
> 
> Comments and commits are welcome!
> 
> Ruben
> <msvc.patch.txt>




More information about the cfe-commits mailing list