Skip to content

Commit 4e59e90

Browse files
Fix #13599 Bad configuration for std::clamp (#7273)
1 parent 81f0086 commit 4e59e90

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

cfg/std.cfg

+3-3
Original file line numberDiff line numberDiff line change
@@ -6374,7 +6374,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
63746374
<!-- template< class T > constexpr const T& std::clamp( const T& v, const T& lo, const T& hi); (since C++17) -->
63756375
<!-- template< class T, class Compare > constexpr const T& std::clamp( const T& v, const T& lo, const T& hi, Compare comp ); (since C++17) -->
63766376
<!-- https://en.cppreference.com/w/cpp/algorithm/clamp -->
6377-
<function name="clamp,std::clamp">
6377+
<function name="std::clamp">
63786378
<use-retval/>
63796379
<noreturn>false</noreturn>
63806380
<leak-ignore/>
@@ -6394,7 +6394,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
63946394
</arg>
63956395
</function>
63966396
<!-- template <class T> const T& min(const T& a, const T& b); -->
6397-
<function name="min,std::min">
6397+
<function name="std::min">
63986398
<use-retval/>
63996399
<noreturn>false</noreturn>
64006400
<leak-ignore/>
@@ -6408,7 +6408,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
64086408
</arg>
64096409
</function>
64106410
<!-- template <class T> const T& max(const T& a, const T& b); -->
6411-
<function name="max,std::max">
6411+
<function name="std::max">
64126412
<use-retval/>
64136413
<noreturn>false</noreturn>
64146414
<leak-ignore/>

test/cfg/std.c

+5
Original file line numberDiff line numberDiff line change
@@ -4897,6 +4897,11 @@ void ignoredReturnValue_abs(int i)
48974897
abs(-100);
48984898
}
48994899

4900+
int clamp(int, int, int, int); // #13599
4901+
void ignoredReturnValue_clamp(int a, int b, int c, int d) {
4902+
clamp(a, b, c, d); // not a library function
4903+
}
4904+
49004905
void nullPointer_asctime(void)
49014906
{
49024907
const struct tm *tm = 0;

0 commit comments

Comments
 (0)