This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Replace unsupported effective-target with dg-options


I accidentally backported tests using { target c++11 } to the branch,
but that only works on trunk. One test was also using C++14-only
features, but is meant to be valid in C++11.

	* testsuite/24_iterators/reverse_iterator/71771.cc: Replace calls to
       C++14 std::rbeing and std::rend. Use dg-options instead of
       effective-target.
	* testsuite/27_io/headers/cstdio/functions_neg.cc: Likewise.
	* testsuite/experimental/numeric/77801.cc: Likewise.

Tested x86_64-linux, committed to gcc-6-branch.

commit d97bb71f4e0cb7735e78ab879dae82886bdc6482
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Nov 23 15:08:17 2016 +0000

    Replace unsupported effective-target with dg-options
    
    	* testsuite/24_iterators/reverse_iterator/71771.cc: Replace calls to
    	C++14 std::rbeing and std::rend.  Use dg-options instead of
    	effective-target.
    	* testsuite/27_io/headers/cstdio/functions_neg.cc: Use dg-options
    	instead of effective-target.
    	* testsuite/experimental/numeric/77801.cc: Likewise.

diff --git a/libstdc++-v3/testsuite/24_iterators/reverse_iterator/71771.cc b/libstdc++-v3/testsuite/24_iterators/reverse_iterator/71771.cc
index 1a7c963..fe08224 100644
--- a/libstdc++-v3/testsuite/24_iterators/reverse_iterator/71771.cc
+++ b/libstdc++-v3/testsuite/24_iterators/reverse_iterator/71771.cc
@@ -15,7 +15,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// { dg-do compile { target c++11 } }
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
 
 #include <iterator>
 #include <testsuite_iterators.h>
@@ -39,5 +40,7 @@ test01()
   int i[2];
   __gnu_test::test_container<int, __gnu_test::bidirectional_iterator_wrapper>
     c(i);
-  diff2(std::rbegin(c), std::rend(c));
+  using reverse_iterator
+    = std::reverse_iterator<__gnu_test::bidirectional_iterator_wrapper<int>>;
+  diff2(reverse_iterator(c.end()), reverse_iterator(c.begin()));
 }
diff --git a/libstdc++-v3/testsuite/27_io/headers/cstdio/functions_neg.cc b/libstdc++-v3/testsuite/27_io/headers/cstdio/functions_neg.cc
index f9e5f86..0df181b 100644
--- a/libstdc++-v3/testsuite/27_io/headers/cstdio/functions_neg.cc
+++ b/libstdc++-v3/testsuite/27_io/headers/cstdio/functions_neg.cc
@@ -1,4 +1,5 @@
-// { dg-do compile  { target c++14 } }
+// { dg-options "-std=gnu++14" }
+// { dg-do compile }
 
 // Copyright (C) 2007-2016 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/experimental/numeric/77801.cc b/libstdc++-v3/testsuite/experimental/numeric/77801.cc
index c4c8bfb..8bee00d 100644
--- a/libstdc++-v3/testsuite/experimental/numeric/77801.cc
+++ b/libstdc++-v3/testsuite/experimental/numeric/77801.cc
@@ -15,7 +15,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// { dg-do compile { target c++14 } }
+// { dg-options "-std=gnu++14" }
+// { dg-do compile }
 
 #include <cstdlib>
 #include <experimental/numeric>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]