Skip to content

Commit ef82477

Browse files
committed
std.cfg: Do not take the return value of std::locale::global() into account.
1 parent 7681bbf commit ef82477

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

cfg/std.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4898,9 +4898,8 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
48984898
<noreturn>false</noreturn>
48994899
<leak-ignore/>
49004900
</function>
4901-
<!-- static std::locale std::locale::global( const locale& loc ); -->
4901+
<!-- static std::locale std::locale::global( const std::locale& loc ); -->
49024902
<function name="std::locale::global">
4903-
<use-retval/>
49044903
<returnValue type="struct std::locale"/>
49054904
<noreturn>false</noreturn>
49064905
<leak-ignore/>

test/cfg/std.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3071,6 +3071,12 @@ void ignoredReturnValue_string_compare(std::string teststr, std::wstring testwst
30713071
testwstr.compare(L"wtest");
30723072
}
30733073

3074+
void ignoredReturnValue_locale_global(const std::locale& loc)
3075+
{
3076+
// no ignoredReturnValue shall be shown for
3077+
std::locale::global(loc);
3078+
}
3079+
30743080
void ignoredReturnValue_make_pair()
30753081
{
30763082
// cppcheck-suppress ignoredReturnValue

0 commit comments

Comments
 (0)