std.cfg: Add support for std::string::assign() (#1660)

Reference: https://en.cppreference.com/w/cpp/string/basic_string/assign
This commit is contained in:
Sebastian 2019-02-11 13:40:36 +01:00 committed by GitHub
parent 71612d58e1
commit 3427e61383
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 0 deletions

View File

@ -6466,6 +6466,40 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
<not-uninit/>
</arg>
</function>
<!-- https://en.cppreference.com/w/cpp/string/basic_string/assign -->
<function name="std::basic_string::assign">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="std::basic_string &amp;"/>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="any">
<not-uninit/>
</arg>
</function>
<function name="std::string::assign">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="std::string &amp;"/>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="any">
<not-uninit/>
</arg>
</function>
<function name="std::wstring::assign">
<noreturn>false</noreturn>
<leak-ignore/>
<returnValue type="std::wstring &amp;"/>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="any">
<not-uninit/>
</arg>
</function>
<!-- std::string& std::string::append (const std::string& str); -->
<function name="std::string::append">
<noreturn>false</noreturn>

View File

@ -3332,6 +3332,9 @@ void stdstring()
std::string s;
// cppcheck-suppress ignoredReturnValue
s.size();
// valid
s.assign("a");
}
void stdvector()