diff mbox

Replace unsupported effective-target with dg-options

Message ID 20161123152747.GD3301@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely Nov. 23, 2016, 3:27 p.m. UTC
On 23/11/16 15:25 +0000, Jonathan Wakely wrote:
>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.


Also committed this version to gcc-5-branch.
diff mbox

Patch

commit 597074d529972bde43c012a0cdca151e823224ab
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Nov 23 15:23:45 2016 +0000

    Replace unsupported effective-target with dg-options
    
    	* testsuite/24_iterators/reverse_iterator/71771.cc: Replace calls to
    	C++14 std::rbegin and std::rend.  Use dg-options instead of
    	effective-target.

diff --git a/libstdc++-v3/testsuite/24_iterators/reverse_iterator/71771.cc b/libstdc++-v3/testsuite/24_iterators/reverse_iterator/71771.cc
index 1a7c963..b7593dd 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>
@@ -38,6 +39,8 @@  test01()
 {
   int i[2];
   __gnu_test::test_container<int, __gnu_test::bidirectional_iterator_wrapper>
-    c(i);
-  diff2(std::rbegin(c), std::rend(c));
+    c(i, i+2);
+  using reverse_iterator
+    = std::reverse_iterator<__gnu_test::bidirectional_iterator_wrapper<int>>;
+  diff2(reverse_iterator(c.end()), reverse_iterator(c.begin()));
 }