Remove C++14-isms from C++11 tests
authorJonathan Wakely <jwakely@redhat.com>
Thu, 23 Aug 2018 08:26:22 +0000 (09:26 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 23 Aug 2018 08:26:22 +0000 (09:26 +0100)
* testsuite/20_util/reference_wrapper/lwg2993.cc: Fix C++11 test to
not use C++14 feature.
* testsuite/23_containers/list/68222_neg.cc: Likewise.

From-SVN: r263801

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/20_util/reference_wrapper/lwg2993.cc
libstdc++-v3/testsuite/23_containers/list/68222_neg.cc

index 5c7cbdbcaa1b8ee6eb9c3fb70cd23a382dcfa289..25218bf4fcfa16741a51a08982febfc92663ec13 100644 (file)
@@ -1,5 +1,9 @@
 2018-08-23  Jonathan Wakely  <jwakely@redhat.com>
 
+       * testsuite/20_util/reference_wrapper/lwg2993.cc: Fix C++11 test to
+       not use C++14 feature.
+       * testsuite/23_containers/list/68222_neg.cc: Likewise.
+
        * testsuite/21_strings/basic_string/init-list.cc:
        Require cxx11-abi.
        * testsuite/experimental/polymorphic_allocator/pmr_typedefs_match.cc:
index 0a339486ef872da0d2399e12486cb4e0e34c4092..fa7cc728abe78b24456ae7a130ad709baa9a4319 100644 (file)
@@ -51,5 +51,5 @@ test02()
 
   // error: no member 'type' because the conditional
   // expression is ill-formed
-  using t = std::common_type_t<std::reference_wrapper<int>, int>;
+  using t = typename std::common_type<std::reference_wrapper<int>, int>::type;
 }
index d969b6a9c525d64a97ae4114df8ed76c2704fe63..cd33762e01adf00bef0538942fb489b4abea53c2 100644 (file)
@@ -26,10 +26,10 @@ test01()
   const std::list<int> nums = { 1, 2, 3, 4 };
 
   // Grab the iterator type.
-  using list_itr_type = decltype( std::cbegin( nums ) );
+  using list_itr_type = decltype( std::begin( nums ) );
 
   // Confirm cend returns the same type.
-  static_assert( std::is_same< decltype( std::cend( nums ) ), list_itr_type >::value, "" );
+  static_assert( std::is_same< decltype( std::end( nums ) ), list_itr_type >::value, "" );
 
   // The list's iterator type provides a well-formed non-member operator-() with valid return type (long int)
   using substraction_type