[gcc r16-9421] libstdc++: Remove unused variable
Jakub Jelinek
jakub@gcc.gnu.org
Tue Jul 28 10:10:54 GMT 2026
https://gcc.gnu.org/g:8546eca4d9d5fdbc4a6996a700156be110ff07fa
commit r16-9421-g8546eca4d9d5fdbc4a6996a700156be110ff07fa
Author: Jakub Jelinek <jakub@redhat.com>
Date: Tue Jul 28 10:52:28 2026 +0200
libstdc++: Remove unused variable
https://builder.sourceware.org/buildbot/#/builders/312/builds/3547
shows
In file included from /home/builder/shared/sw3bb1/worker/gcc-fullest-debian-amd64/gcc-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/deque:72,
from /home/builder/shared/sw3bb1/worker/gcc-fullest-debian-amd64/gcc-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/stack:68,
from ../../gcc/gcc/cobol/cobol-system.h:52,
from ../../gcc/gcc/cobol/lexio.cc:33:
/home/builder/shared/sw3bb1/worker/gcc-fullest-debian-amd64/gcc-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/bits/deque.tcc: In instantiation of ‘std::_Deque_iterator<_OTp, _OTp&, _OTp*> std::__uninitialized_copy_a(_Deque_iterator<_Tp, _Ref, _Ptr>, _Deque_iterator<_Tp, _Ref, _Ptr>, _Deque_iterator<_OTp, _OTp&, _OTp*>, allocator<_Tp>&) [with _ITp = source_format_t; _IRef = const source_format_t&; _IPtr = const source_format_t*; _OTp = source_format_t; _Tp = source_format_t]’:
/home/builder/shared/sw3bb1/worker/gcc-fullest-debian-amd64/gcc-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_deque.h:922:36: required from ‘std::deque<_Tp, _Alloc>::deque(const std::deque<_Tp, _Alloc>&) [with _Tp = source_format_t; _Alloc = std::allocator<source_format_t>]’
922 | { std::__uninitialized_copy_a(__x.begin(), __x.end(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
923 | this->_M_impl._M_start,
| ~~~~~~~~~~~~~~~~~~~~~~~
924 | _M_get_Tp_allocator()); }
| ~~~~~~~~~~~~~~~~~~~~~~
/home/builder/shared/sw3bb1/worker/gcc-fullest-debian-amd64/gcc-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_stack.h:107:11: required from here
107 | class stack
| ^~~~~
/home/builder/shared/sw3bb1/worker/gcc-fullest-debian-amd64/gcc-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/bits/deque.tcc:1577:19: error: unused variable ‘__sres’ [-Werror=unused-variable]
1577 | _OTp* __sres = __result._M_cur;
| ^~~~~~
cc1plus: all warnings being treated as errors
make[3]: *** [Makefile:1218: cobol/lexio.o] Error 1
There is indeed an unused variable introduced in r16-8142.
The following patch removes it.
2026-07-28 Jakub Jelinek <jakub@redhat.com>
* include/bits/deque.tcc (std::__uninitialized_copy_a): Remove unused
variable __sres.
(cherry picked from commit 51c8f33686071ce874915a6cfeb85f337071d45d)
Diff:
---
libstdc++-v3/include/bits/deque.tcc | 1 -
1 file changed, 1 deletion(-)
diff --git a/libstdc++-v3/include/bits/deque.tcc b/libstdc++-v3/include/bits/deque.tcc
index b35f268b0db1..df4be0802124 100644
--- a/libstdc++-v3/include/bits/deque.tcc
+++ b/libstdc++-v3/include/bits/deque.tcc
@@ -1574,7 +1574,6 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
__n = __last._M_cur - __from;
else
__n = __first._M_last - __from;
- _OTp* __sres = __result._M_cur;
__n = std::min<ptrdiff_t>(__n, __result._M_last - __result._M_cur);
std::uninitialized_copy(__from, __from + __n, __result._M_cur);
__first += __n;
More information about the Libstdc++-cvs
mailing list