[libcxx-commits] [PATCH] D147860: [libcxxabi] [test] Mark code following an assert(false) as unreachable

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 18 23:56:39 PDT 2023


mstorsjo updated this revision to Diff 514838.
mstorsjo added a comment.

Fix the warning by just adding a `return nullptr;`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147860/new/

https://reviews.llvm.org/D147860

Files:
  libcxxabi/test/cxa_vec_new_overflow_PR41395.pass.cpp


Index: libcxxabi/test/cxa_vec_new_overflow_PR41395.pass.cpp
===================================================================
--- libcxxabi/test/cxa_vec_new_overflow_PR41395.pass.cpp
+++ libcxxabi/test/cxa_vec_new_overflow_PR41395.pass.cpp
@@ -18,7 +18,7 @@
 void dummy_ctor(void*) { assert(false && "should not be called"); }
 void dummy_dtor(void*) { assert(false && "should not be called"); }
 
-void *dummy_alloc(size_t) { assert(false && "should not be called"); }
+void *dummy_alloc(size_t) { assert(false && "should not be called"); return nullptr; }
 void dummy_dealloc(void*) { assert(false && "should not be called"); }
 void dummy_dealloc_sized(void*, size_t) { assert(false && "should not be called"); }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147860.514838.patch
Type: text/x-patch
Size: 720 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230419/b8800624/attachment.bin>


More information about the libcxx-commits mailing list