[patch] [libcxx] new/.cpp trivial warning fix.

Marshall Clow mclow.lists at gmail.com
Thu Oct 24 18:27:06 PDT 2013


On Oct 24, 2013, at 3:49 PM, G M <gmisocpp at gmail.com> wrote:

> Attached are some trivial fixes for MSVC that remove numerous warning distractions in <new> and new.cpp.
> VC doesn't fully support these constructs. The existing and new code will obsolete itself for compilers that don't need it.
> 

I don't understand this code:

 _LIBCPP_NEW_DELETE_VIS void* operator new(std::size_t __sz)
 #if !__has_feature(cxx_noexcept)
+#if defined(_LIBCPP_MSVC)
+    throw(...)
+#else
     throw(std::bad_alloc)
 #endif
+#endif
 ;

Are you anticipating that operator new will throw things other than std::bad_alloc?
Or does MSVC just hate exception specifications?
[ I'm not really that fond of them, but still …. ]


-- Marshall

Marshall Clow     Idio Software   <mailto:mclow.lists at gmail.com>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki





More information about the cfe-commits mailing list