Skip to content

Commit

Permalink
[libcxxabi] [test] Avoid mingw warnings about missing a return statement
Browse files Browse the repository at this point in the history
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
mingw-w64/mingw-w64@1690994
though.

Differential Revision: https://reviews.llvm.org/D147860
  • Loading branch information
mstorsjo committed Apr 19, 2023
1 parent 692518d commit f3ee669
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libcxxabi/test/cxa_vec_new_overflow_PR41395.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"); }

Expand Down

0 comments on commit f3ee669

Please sign in to comment.