Skip to content

Commit 3783374

Browse files
Fix #13801 FP constParameterPointer due to bad library configuration (danmar#7488)
Co-authored-by: chrchr-github <noreply@github.com>
1 parent f347483 commit 3783374

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

cfg/std.cfg

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6653,7 +6653,6 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
66536653
<!-- std::ios::pos_type std::ifstream::tellg( void ); -->
66546654
<function name="std::istream::tellg,std::basic_istream::tellg,std::ifstream::tellg,std::basic_ifstream::tellg">
66556655
<use-retval/>
6656-
<const/>
66576656
<returnValue type="std::ios::pos_type"/>
66586657
<noreturn>false</noreturn>
66596658
</function>
@@ -8696,7 +8695,7 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init
86968695
<returnValue type="bool"/>
86978696
<use-retval/>
86988697
<leak-ignore/>
8699-
<arg nr="1" direction="in">
8698+
<arg nr="1">
87008699
<not-uninit/>
87018700
</arg>
87028701
</function>
@@ -8754,7 +8753,7 @@ initializer list (7) string& replace (const_iterator i1, const_iterator i2, init
87548753
</function>
87558754
<function name="std::auto_ptr::reset,std::shared_ptr::reset,std::unique_ptr::reset,std::weak_ptr::reset">
87568755
<noreturn>false</noreturn>
8757-
<arg nr="1" direction="in" default="0">
8756+
<arg nr="1" default="0">
87588757
<not-uninit/>
87598758
</arg>
87608759
</function>

test/cfg/std.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5163,6 +5163,22 @@ void constVariablePointer_push_back(std::vector<T*>& d, const std::vector<T*>& s
51635163
}
51645164
}
51655165

5166+
std::streampos constParameterPointer_istream_tellg(std::istream* p) { // #13801
5167+
return p->tellg();
5168+
}
5169+
5170+
void constParameterPointer_unique_ptr_reset(std::unique_ptr<int>& u, int* p) {
5171+
u.reset(p);
5172+
}
5173+
5174+
bool constParameterPointer_map_contains(const std::map<int*, int>& m, int* p) {
5175+
#if __cplusplus >= 202002L
5176+
return m.contains(p);
5177+
#else
5178+
return m.count(p) > 0;
5179+
#endif
5180+
}
5181+
51665182
// cppcheck-suppress constParameterReference
51675183
void constParameterReference_push_back(std::vector<std::string>& v, std::string& s) { // #12661
51685184
v.push_back(s);

0 commit comments

Comments
 (0)