[PATCH] D21625: [libcxx] [test] Mark throw_bad_alloc_helper() as [[noreturn]].

Stephan T. Lavavej via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 22 15:21:13 PDT 2016

STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.

Mark throw_bad_alloc_helper() as [[noreturn]].

This avoids MSVC /analyze warnings about new returning null, since [[noreturn]] allows the analyzer to see what's happening.



Index: test/support/count_new.hpp
--- test/support/count_new.hpp
+++ test/support/count_new.hpp
@@ -24,6 +24,9 @@
 namespace detail
+#if TEST_STD_VER >= 11
+   [[noreturn]]
    inline void throw_bad_alloc_helper() {
        throw std::bad_alloc();

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21625.61618.patch
Type: text/x-patch
Size: 361 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160622/439fa81c/attachment.bin>

More information about the cfe-commits mailing list