The c++11 effective-target isn't supported on gcc-5-branch, so these
tests need to use dg-options instead. (I'll be glad when we close
gcc-5-branch and I don't have to remember this!)

One of the tests FAILed when this was fixed, because it was also using
a constructor of __gnu_test::test_container that doesn't exist on
gcc-5-branch. So I fixed that too.

        * testsuite/20_util/reference_wrapper/80504.cc: Do not use invalid
        effective-target.
        * testsuite/22_locale/conversions/buffer/2.cc: Likewise.
        * testsuite/28_regex/basic_regex/ctors/basic/iter.cc: Likewise. Fix
        use of test_container.

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

commit 397c9db7d7a08ded788d5d7cc3c8bc9ec6525eec
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Wed Sep 13 15:56:08 2017 +0100

    Fix libstdc++ tests using invalid effective-target
    
            * testsuite/20_util/reference_wrapper/80504.cc: Do not use invalid
            effective-target.
            * testsuite/22_locale/conversions/buffer/2.cc: Likewise.
            * testsuite/28_regex/basic_regex/ctors/basic/iter.cc: Likewise. Fix
            use of test_container.

diff --git a/libstdc++-v3/testsuite/20_util/reference_wrapper/80504.cc 
b/libstdc++-v3/testsuite/20_util/reference_wrapper/80504.cc
index 727a560cd17..d46ffcd056b 100644
--- a/libstdc++-v3/testsuite/20_util/reference_wrapper/80504.cc
+++ b/libstdc++-v3/testsuite/20_util/reference_wrapper/80504.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 <functional>
 
diff --git a/libstdc++-v3/testsuite/22_locale/conversions/buffer/2.cc 
b/libstdc++-v3/testsuite/22_locale/conversions/buffer/2.cc
index 8eda714b61d..3efb51ff1c2 100644
--- a/libstdc++-v3/testsuite/22_locale/conversions/buffer/2.cc
+++ b/libstdc++-v3/testsuite/22_locale/conversions/buffer/2.cc
@@ -15,7 +15,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// { dg-do run { target c++11 } }
+// { dg-options "-std=gnu++11" }
+// { dg-do run }
 
 #include <locale>
 #include <sstream>
diff --git a/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/iter.cc 
b/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/iter.cc
index 7776c5fd557..4c70e0d6241 100644
--- a/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/iter.cc
+++ b/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/iter.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 <regex>
 #include <testsuite_iterators.h>
@@ -24,7 +25,8 @@ void
 test01()
 {
   char s[] = "";
-  __gnu_test::test_container<char, __gnu_test::forward_iterator_wrapper> c(s);
+  __gnu_test::test_container<char, __gnu_test::forward_iterator_wrapper>
+    c(s, s+1);
   std::regex r1(c.begin(), c.end());
   std::regex r2(c.begin(), c.end(), std::regex_constants::grep);
 }

Reply via email to