[committed] libstdc++: Enable __gnu_test::test_container constructor for C++98

Message ID 20250415082632.2239459-1-jwakely@redhat.com
State Committed
Commit 8a208899e92e25f5d80b5a15548d39ea5551f492
Headers
Series [committed] libstdc++: Enable __gnu_test::test_container constructor for C++98 |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gcc_build--master-arm fail Patch failed to apply

Commit Message

Jonathan Wakely April 15, 2025, 8:25 a.m. UTC
  The only reason this constructor wasn't defined for C++98 is that it
uses constructor delegation, but that isn't necessary.

libstdc++-v3/ChangeLog:

	* testsuite/util/testsuite_iterators.h (test_container): Define
	array constructor for C++98 as well.
---

I don't remember why I defined this using a delegating constructor when
it's actually fewer characters to call the base constructor directly.

Tested x86_64-linux. Pushed to trunk.

 libstdc++-v3/testsuite/util/testsuite_iterators.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
  

Patch

diff --git a/libstdc++-v3/testsuite/util/testsuite_iterators.h b/libstdc++-v3/testsuite/util/testsuite_iterators.h
index 0df6dcc5af5..20539ecaca6 100644
--- a/libstdc++-v3/testsuite/util/testsuite_iterators.h
+++ b/libstdc++-v3/testsuite/util/testsuite_iterators.h
@@ -610,12 +610,10 @@  namespace __gnu_test
     test_container(T* _first, T* _last) : bounds(_first, _last)
     { }
 
-#if __cplusplus >= 201103L
     template<std::size_t N>
       explicit
-      test_container(T (&arr)[N]) : test_container(arr, arr+N)
+      test_container(T (&arr)[N]) : bounds(arr, arr+N)
       { }
-#endif
 
     ItType<T>
     it(int pos)