]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: testsuite: work around bitset namespace pollution
authorAlexandre Oliva <oliva@adacore.com>
Wed, 22 Jun 2022 02:11:00 +0000 (23:11 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Wed, 22 Jun 2022 02:11:00 +0000 (23:11 -0300)
rtems6 declares a global struct bitset in a header file included
indirectly by sys/types.h, that ambiguates the unqualified references
to bitset after "using namespace std" in the testsuite.

Work around the namespace pollution with using declarations of
std::bitset.

for  libstdc++-v3/ChangeLog

* testsuite/23_containers/bitset/cons/dr1325-2.cc: Work around
global struct bitset.
* testsuite/23_containers/bitset/ext/15361.cc: Likewise.
* testsuite/23_containers/bitset/input/1.cc: Likewise.
* testsuite/23_containers/bitset/to_string/1.cc: Likewise.
* testsuite/23_containers/bitset/to_string/dr396.cc: Likewise.

libstdc++-v3/testsuite/23_containers/bitset/cons/dr1325-2.cc
libstdc++-v3/testsuite/23_containers/bitset/ext/15361.cc
libstdc++-v3/testsuite/23_containers/bitset/input/1.cc
libstdc++-v3/testsuite/23_containers/bitset/to_string/1.cc
libstdc++-v3/testsuite/23_containers/bitset/to_string/dr396.cc

index 4b79c9f046dbc0446db3b09c57b1b08c63a11172..2371bef09cca74081a8d123610e7d08cb99b63cc 100644 (file)
@@ -39,6 +39,7 @@ template<std::size_t Nb, typename CharT>
 void test01()
 {
   using namespace std;
+  using std::bitset; // Work around struct ::bitset on rtems.
 
   const char s1[4] = { '0', '1', '0', '1' };
   VERIFY( bitset<4>(s1, 4) == test01_ref<4>(s1, 4) );
index 40cb94966ab8f1c05f3156c4f88655f5ea8fbd44..392470084aee592fe0045a2f39c9296f1533200e 100644 (file)
@@ -22,6 +22,7 @@
 void test01()
 {
   using namespace std;
+  using std::bitset; // Work around struct ::bitset on rtems.
 
   bitset<256> b;
   b.set(225);
index 8738c772383776240cf7206daafba80b0cc78ebd..939861b171eaa2f8a023ecce0a83246fa3d488dd 100644 (file)
@@ -26,6 +26,7 @@
 void test01()
 {
   using namespace std;
+  using std::bitset; // Work around struct ::bitset on rtems.
 
   bitset<5>      b5;
   bitset<0>      b0;
index f4af91373cc37f967ada265f997df7b5b140d8ce..8384eb96d2547323abf0762179810111643a4106 100644 (file)
@@ -25,6 +25,7 @@
 void test01()
 {
   using namespace std;
+  using std::bitset; // Work around struct ::bitset on rtems.
 
   bitset<5> b5;
   string s0 = b5.to_string<char, char_traits<char>, allocator<char> >();
index 8faded348479a900ea07991260a36218dd01dfee..dfba27ed3afa17c05f7c4a8ba0d83cd609b11301 100644 (file)
@@ -26,6 +26,7 @@
 void test01()
 {
   using namespace std;
+  using std::bitset; // Work around struct ::bitset on rtems.
 
   bitset<5> b5;
   string s0 = b5.to_string<char, char_traits<char>, allocator<char> >('a', 'b');