Fix tests that fail without PCH
authorJonathan Wakely <jwakely@redhat.com>
Mon, 17 Jun 2019 08:18:17 +0000 (09:18 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 17 Jun 2019 08:18:17 +0000 (09:18 +0100)
The recent change to stop transitively including <string> broke some
tests, but only when the library is configured without PCH, because
otherwise the <string> header still gets included via the precompiled
<bits/stdc++.h> header.

* testsuite/20_util/bad_function_call/what.cc: Include <string> header
for std::string.
* testsuite/20_util/shared_ptr/cons/weak_ptr_expired.cc: Likewise.
* testsuite/20_util/tuple/cons/allocator_with_any.cc: Include <memory>
header for std::allocator.
* testsuite/23_containers/array/tuple_interface/tuple_element.cc: Add
using-declaration for std::size_t.
* testsuite/23_containers/array/tuple_interface/tuple_size.cc:
Likewise.
* testsuite/23_containers/deque/cons/55977.cc: Include <istream> for
std::istream.
* testsuite/23_containers/vector/cons/55977.cc: Likewise.
* testsuite/experimental/map/erasure.cc: Include <string> for
std::string.
* testsuite/experimental/unordered_map/erasure.cc: Likewise.

From-SVN: r272376

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/20_util/bad_function_call/what.cc
libstdc++-v3/testsuite/20_util/shared_ptr/cons/weak_ptr_expired.cc
libstdc++-v3/testsuite/20_util/tuple/cons/allocator_with_any.cc
libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element.cc
libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_size.cc
libstdc++-v3/testsuite/23_containers/deque/cons/55977.cc
libstdc++-v3/testsuite/23_containers/vector/cons/55977.cc
libstdc++-v3/testsuite/experimental/map/erasure.cc
libstdc++-v3/testsuite/experimental/unordered_map/erasure.cc

index 9eb70fcf8b6b12f76a79ee05fbb4f07b872a8d1b..542c937c4ab6327ec28420bf4ad99990adb1edb1 100644 (file)
@@ -1,3 +1,21 @@
+2019-06-17  Jonathan Wakely  <jwakely@redhat.com>
+
+       * testsuite/20_util/bad_function_call/what.cc: Include <string> header
+       for std::string.
+       * testsuite/20_util/shared_ptr/cons/weak_ptr_expired.cc: Likewise.
+       * testsuite/20_util/tuple/cons/allocator_with_any.cc: Include <memory>
+       header for std::allocator.
+       * testsuite/23_containers/array/tuple_interface/tuple_element.cc: Add
+       using-declaration for std::size_t.
+       * testsuite/23_containers/array/tuple_interface/tuple_size.cc:
+       Likewise.
+       * testsuite/23_containers/deque/cons/55977.cc: Include <istream> for
+       std::istream.
+       * testsuite/23_containers/vector/cons/55977.cc: Likewise.
+       * testsuite/experimental/map/erasure.cc: Include <string> for
+       std::string.
+       * testsuite/experimental/unordered_map/erasure.cc: Likewise.
+
 2019-06-14  Jonathan Wakely  <jwakely@redhat.com>
 
        * include/experimental/type_traits (experimental::nonesuch): Use
index e17b42feedd3f16d10277c380be7e0022d158e36..229c7ef1cab58a50271d1a835f6cba76b195e7f0 100644 (file)
@@ -18,6 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 #include <functional>
+#include <string>
 #include <testsuite_hooks.h>
 
 int main()
index f9c44cd60f3759ef0b3289c9491ad1dfab8e5800..a32a5c919430c72db836ec1686e42b4dd9da049d 100644 (file)
@@ -20,6 +20,7 @@
 // 20.6.6.2 Template class shared_ptr [util.smartptr.shared]
 
 #include <memory>
+#include <string>
 #include <testsuite_hooks.h>
 
 struct A { };
index 655b5328bdab893d221075ef965dd5a45799319b..154ec9161bd11df2e392c547c86392dcbc5117f2 100644 (file)
@@ -23,6 +23,7 @@
 // this test may begin to fail.
 
 #include <tuple>
+#include <memory>
 #include <experimental/any>
 #include <testsuite_hooks.h>
 
index b6fda44a3c5a6e5f06ca957f362c1d7de9b7de4d..e8b6bc12e77932f0ae56465442d3019c7794c194 100644 (file)
@@ -29,7 +29,7 @@ test01()
   // This relies on the fact that <utility> includes <type_traits>:
   using std::is_same;
 
-  const size_t len = 3;
+  const std::size_t len = 3;
   typedef array<int, len> array_type;
 
   static_assert(is_same<tuple_element<0, array_type>::type, int>::value, "" );
index aedd5fc2a2d8cfeab91e7e79788d36361c1bdcd0..740c42a89145473636ea5d20fcd1bf3afb5129ec 100644 (file)
@@ -26,6 +26,7 @@ test01()
 {
   using std::array;
   using std::tuple_size;
+  using std::size_t;
   // This relies on the fact that <utility> includes <type_traits>:
   using std::is_same;
 
index 492aedf97b4aaf650907f000858824ece372539a..5ab516a29508cac697f6e5edced30891ab59dc0a 100644 (file)
@@ -21,6 +21,7 @@
 #include <utility>
 #include <deque>
 #include <iterator>
+#include <istream>
 
 template <class T>
 struct MyAllocator
index f77679235928dec03f27419c326af4f83c2a94d2..efa03b1edfdd076adb6673f046ee19fb0da4703c 100644 (file)
@@ -21,6 +21,7 @@
 #include <utility>
 #include <vector>
 #include <iterator>
+#include <istream>
 
 template <class T>
 struct MyAllocator
index c636fcbb1b53b97f610e024c7246a3afc2a9ca22..aa3d42da29965522cc1feca2dca042a98e5e86f5 100644 (file)
@@ -18,6 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 #include <experimental/map>
+#include <string>
 #include <testsuite_hooks.h>
 
 auto is_odd_pair = [](const std::pair<const int, std::string>& p)
index c08fa3152710a4faeed91d9c4a42af94b5065259..79a42ffbdf907ef8ac2182172bf6a597c159fb8c 100644 (file)
@@ -18,6 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 #include <experimental/unordered_map>
+#include <string>
 #include <testsuite_hooks.h>
 
 auto is_odd_pair = [](const std::pair<const int, std::string>& p)