summaryrefslogtreecommitdiff
path: root/libcxxabi
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2023-04-02 01:45:07 +0300
committerMartin Storsjö <martin@martin.st>2023-04-19 13:35:37 +0300
commitf3ee6695e0f6232fee96e2e6ccd96e85ed682998 (patch)
tree71dbe17daa7c15ebb2553327b4bb260409d2eddf /libcxxabi
parent692518d04b2d170b1ae10c50843e7c497c4a9922 (diff)
downloadllvm-f3ee6695e0f6232fee96e2e6ccd96e85ed682998.tar.gz
[libcxxabi] [test] Avoid mingw warnings about missing a return statement
With current versions of mingw-w64 headers, code following assert(false) isn't considered unreachable - thus add a dummy "return nullptr;", to avoid warnings (treated as errors) for a missing return statement. The root cause does get fixed further upstream in mingw-w64 in https://github.com/mingw-w64/mingw-w64/commit/1690994f515910a31b9fb7c7bd3a52d4ba987abe though. Differential Revision: https://reviews.llvm.org/D147860
Diffstat (limited to 'libcxxabi')
-rw-r--r--libcxxabi/test/cxa_vec_new_overflow_PR41395.pass.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcxxabi/test/cxa_vec_new_overflow_PR41395.pass.cpp b/libcxxabi/test/cxa_vec_new_overflow_PR41395.pass.cpp
index 16239e75f559..a4a2bbd99e6e 100644
--- a/libcxxabi/test/cxa_vec_new_overflow_PR41395.pass.cpp
+++ b/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"); }