Skip to content

Commit 54b482c

Browse files
Fix #14374 FP missingReturn with std::throw_with_nested() (#8638)
1 parent 37b5e95 commit 54b482c

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

cfg/std.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8814,6 +8814,12 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init
88148814
<use-retval/>
88158815
<leak-ignore/>
88168816
</function>
8817+
<function name="std::throw_with_nested">
8818+
<arg nr="1" direction="in" indirect="0"/>
8819+
<returnValue type="void"/>
8820+
<noreturn>true</noreturn>
8821+
<leak-ignore/>
8822+
</function>
88178823
<memory>
88188824
<alloc init="false" buffer-size="malloc">malloc,std::malloc</alloc>
88198825
<alloc init="true" buffer-size="calloc">calloc,std::calloc</alloc>

test/cfg/std.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5379,3 +5379,13 @@ int containerOutOfBounds_std_initializer_list() { // #14340
53795379
int i = *x.end();
53805380
return i + containerOutOfBounds_std_initializer_list_access(x);
53815381
}
5382+
5383+
int* missingReturn_std_throw_with_nested() { // #14374
5384+
try {
5385+
int* p = new int();
5386+
return p;
5387+
}
5388+
catch (...) {
5389+
std::throw_with_nested(std::runtime_error("xyz"));
5390+
}
5391+
}

0 commit comments

Comments
 (0)