On 2026-02-26 14:00, Jonathan Wakely wrote:
On Thu, 26 Feb 2026 at 12:43, Tomasz Kaminski <[email protected]> wrote:
I have checked, and there are only four uses of size_t in the file, so I think
we could as well std qualify them.
That would be my preference.
It's only a test, so I don't really care whether it has 'using
std::size_t' once, or qualifies each use.
I agree that we don't need 17 lines of errors in the commit log when
it's all caused by the same thing.
OK for trunk with a shorter commit log.
Pushed as r16-7716-g1c842aa818b319.
Kind regards,
Torbjörn
On Thu, Feb 26, 2026 at 1:24 PM Torbjörn SVENSSON
<[email protected]> wrote:
Changes since v1:
- Replaced "#include <cstddef>" with "using std::size_t;".
Ok for trunk?
--
Without a definition for size_t, there are errors like these for
arm-none-eabi:
.../requirements_neg.cc:5: error: 'size_t' has not been declared
.../requirements_neg.cc:12: error: 'size_t' has not been declared
.../requirements_neg.cc:13: error: 'N' was not declared in this scope
.../requirements_neg.cc:13: error: template argument 1 is invalid
.../requirements_neg.cc:15: error: template argument 1 is invalid
.../requirements_neg.cc:16: error: template argument 1 is invalid
.../requirements_neg.cc:17: error: template argument 1 is invalid
.../requirements_neg.cc:18: error: template argument 1 is invalid
.../requirements_neg.cc:20: error: 'size_t' has not been declared
.../requirements_neg.cc:23: error: 'N' was not declared in this scope
[-Wtemplate-body]
.../requirements_neg.cc:26: error: 'size_t' has not been declared
.../requirements_neg.cc:27: error: 'N' was not declared in this scope
.../requirements_neg.cc:27: error: template argument 1 is invalid
.../requirements_neg.cc:29: error: template argument 1 is invalid
.../requirements_neg.cc:30: error: template argument 1 is invalid
.../requirements_neg.cc:31: error: template argument 1 is invalid
.../requirements_neg.cc:32: error: template argument 1 is invalid
libstdc++-v3/ChangeLog:
* testsuite/29_atomics/atomic_ref/requirements_neg.cc: Add
using std::size_t.
Signed-off-by: Torbjörn SVENSSON <[email protected]>
---
.../testsuite/29_atomics/atomic_ref/requirements_neg.cc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_ref/requirements_neg.cc
b/libstdc++-v3/testsuite/29_atomics/atomic_ref/requirements_neg.cc
index 8b0abbde023..a3613e0e733 100644
--- a/libstdc++-v3/testsuite/29_atomics/atomic_ref/requirements_neg.cc
+++ b/libstdc++-v3/testsuite/29_atomics/atomic_ref/requirements_neg.cc
@@ -2,6 +2,8 @@
#include <atomic>
+using std::size_t;
+
template<size_t N>
struct NonTrivial
{
--
2.43.0