Skip to content

Commit fc4b9d3

Browse files
committed
test/cfg: Improved testing of std.cfg about std::stod().
1 parent 8936985 commit fc4b9d3

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

cfg/std.cfg

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3501,6 +3501,19 @@
35013501
</arg>
35023502
<arg nr="2"/>
35033503
</function>
3504+
<!-- double stod (const string& str, size_t* idx = 0); -->
3505+
<!-- double stod (const wstring& str, size_t* idx = 0); -->
3506+
<function name="std::stod">
3507+
<use-retval/>
3508+
<noreturn>false</noreturn>
3509+
<leak-ignore/>
3510+
<arg nr="1">
3511+
<not-uninit/>
3512+
</arg>
3513+
<arg nr="2">
3514+
<not-uninit/>
3515+
</arg>
3516+
</function>
35043517
<!-- size_t mbrtowc(wchar_t* pwc, const char* pmb, size_t max, mbstate_t* ps); -->
35053518
<function name="mbrtowc,std::mbrtowc">
35063519
<noreturn>false</noreturn>

test/cfg/std.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2489,6 +2489,17 @@ void uninivar_wcstof(void)
24892489
(void)std::wcstold(s,endp);
24902490
}
24912491

2492+
void uninivar_stod(void)
2493+
{
2494+
std::string str;
2495+
std::wstring wstr;
2496+
size_t* idx;
2497+
// cppcheck-suppress uninitvar
2498+
(void)std::stod(str,idx);
2499+
// cppcheck-suppress uninitvar
2500+
(void)std::stod(wstr,idx);
2501+
}
2502+
24922503
void uninivar_mbrtowc(void)
24932504
{
24942505
wchar_t* pwc;

0 commit comments

Comments
 (0)