libstdc++: Fix some non-uglified names

Jakub wrote a plugin which identified some non-reserved names being used
in our headers. The "count" one is actually a reserved name (there's
std::set::count and std::count and std::bitset::count) but we might as
well uglify it when used as a function parameter name. I think the "ext"
ones must have happened when moving function definitions from fs_path.cc
to fs_path.h and I forgot to change them.

The __cond::wait and __cond::wait_recursive member functions are using
non-reserved names, so that should be changed too, but this patch
doesn't fix that. I don't think we use the __gnu_cxx::__cond type in any
headers, so maybe that should just be moved into libsupc++/guard.cc or a
new header which is not installed and only used while building the
library.

libstdc++-v3/ChangeLog:

	* include/bits/chrono_io.h (__formatter_duration::_S_subseconds):
	Uglify subs variable name.
	* include/bits/fs_path.h (path::stem, path::extension)
	(path::has_stem, path::has_extension): Uglify ext parameter
	name.
	* include/ext/concurrence.h (__cond::wait, __cond::wait_recursive):
	Uglify mutex parameter names.
	* include/pstl/glue_algorithm_defs.h (generate_n): Uglify count
	parameter name.
	* include/std/ranges (zip_transform_view): Uglify Rs template
	parameter name.
	(__cartesian_is_sized_sentinel): Uglify FirstSent template
	parameter name.
	* include/tr1/riemann_zeta.tcc: Uglify max_size variable name.
This commit is contained in:
Jonathan Wakely
2026-03-17 15:37:24 +00:00
committed by Jonathan Wakely
parent 892451e7b6
commit 62dec39dbd
6 changed files with 25 additions and 23 deletions

View File

@@ -1882,8 +1882,8 @@ namespace __format
{
using _Attoseconds = _ChronoData<_CharT>::_Attoseconds;
using _CRep = common_type_t<_Rep, typename _Attoseconds::rep>;
chrono::duration<_CRep, _Period> subs(__d.count());
return chrono::duration_cast<_Attoseconds>(subs);
chrono::duration<_CRep, _Period> __subs(__d.count());
return chrono::duration_cast<_Attoseconds>(__subs);
}
}

View File

@@ -1304,33 +1304,33 @@ namespace __detail
inline path
path::stem() const
{
auto ext = _M_find_extension();
if (ext.first && ext.second != 0)
return path{ext.first->substr(0, ext.second)};
auto __ext = _M_find_extension();
if (__ext.first && __ext.second != 0)
return path{__ext.first->substr(0, __ext.second)};
return {};
}
inline path
path::extension() const
{
auto ext = _M_find_extension();
if (ext.first && ext.second != string_type::npos)
return path{ext.first->substr(ext.second)};
auto __ext = _M_find_extension();
if (__ext.first && __ext.second != string_type::npos)
return path{__ext.first->substr(__ext.second)};
return {};
}
inline bool
path::has_stem() const noexcept
{
auto ext = _M_find_extension();
return ext.first && ext.second != 0;
auto __ext = _M_find_extension();
return __ext.first && __ext.second != 0;
}
inline bool
path::has_extension() const noexcept
{
auto ext = _M_find_extension();
return ext.first && ext.second != string_type::npos;
auto __ext = _M_find_extension();
return __ext.first && __ext.second != string_type::npos;
}
inline bool

View File

@@ -290,22 +290,22 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#endif
}
void wait(__mutex *mutex)
void wait(__mutex *__mx)
{
#if __GTHREADS
{
if (__gthread_cond_wait(&_M_cond, mutex->gthread_mutex()) != 0)
if (__gthread_cond_wait(&_M_cond, __mx->gthread_mutex()) != 0)
__throw_concurrence_wait_error();
}
#endif
}
void wait_recursive(__recursive_mutex *mutex)
void wait_recursive(__recursive_mutex *__mx)
{
#if __GTHREADS
{
if (__gthread_cond_wait_recursive(&_M_cond,
mutex->gthread_recursive_mutex())
__mx->gthread_recursive_mutex())
!= 0)
__throw_concurrence_wait_error();
}

View File

@@ -202,7 +202,7 @@ generate(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator _
template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Generator>
__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
generate_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size count, _Generator __g);
generate_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size __count, _Generator __g);
// [alg.remove]

View File

@@ -5261,8 +5261,9 @@ namespace views::__adaptor
{ return _M_zip.size(); }
};
template<class _Fp, class... Rs>
zip_transform_view(_Fp, Rs&&...) -> zip_transform_view<_Fp, views::all_t<Rs>...>;
template<class _Fp, class... _Rs>
zip_transform_view(_Fp, _Rs&&...)
-> zip_transform_view<_Fp, views::all_t<_Rs>...>;
template<move_constructible _Fp, input_range... _Vs>
requires (view<_Vs> && ...) && (sizeof...(_Vs) > 0) && is_object_v<_Fp>
@@ -8511,9 +8512,10 @@ namespace views::__adaptor
template<typename... _Vs>
concept __cartesian_product_is_sized = (sized_range<_Vs> && ...);
template<bool _Const, template<typename> class FirstSent, typename _First, typename... _Vs>
template<bool _Const, template<typename> class _FirstSent,
typename _First, typename... _Vs>
concept __cartesian_is_sized_sentinel
= (sized_sentinel_for<FirstSent<__maybe_const_t<_Const, _First>>,
= (sized_sentinel_for<_FirstSent<__maybe_const_t<_Const, _First>>,
iterator_t<__maybe_const_t<_Const, _First>>>
&& ...
&& (sized_range<__maybe_const_t<_Const, _Vs>>

View File

@@ -83,9 +83,9 @@ namespace tr1
if (__s < _Tp(1))
std::__throw_domain_error(__N("Bad argument in zeta sum."));
const unsigned int max_iter = 10000;
const unsigned int __max_iter = 10000;
_Tp __zeta = _Tp(0);
for (unsigned int __k = 1; __k < max_iter; ++__k)
for (unsigned int __k = 1; __k < __max_iter; ++__k)
{
_Tp __term = std::pow(static_cast<_Tp>(__k), -__s);
if (__term < std::numeric_limits<_Tp>::epsilon())