diff mbox

Add #warning to <regex> in 4.8 branch and remove tests

Message ID 20140613111811.GD30729@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely June 13, 2014, 11:18 a.m. UTC
How do people feel about this change, to add a #warning to the <regex>
header saying it's not implemented?

This might stop people reporting bugs that it doesn't work (we know!)
or complaining that the code shouldn't be shipped if it doesn't work.

Now that we have an implementation in the 4.9.0 release we can direct
people to that.

We might as well stop testing the non-functional code in the 4.8
branch as well (that's just 'git rm -r testsuite/28_regex' but not
shown in this patch).
diff mbox

Patch

commit baaad1f3a498a3cac87e84640ba8880532cd3032
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Jun 13 11:52:37 2014 +0100

    	* include/std/regex: Add warning.
    	* src/c++11/regex.cc: Suppress warning.
    	* include/precompiled/stdc++.h: Do not include <regex>.
    	* testsuite/17_intro/using_namespace_std_tr1_neg.cc: Likewise.
    	* testsuite/28_regex/*: Remove.

diff --git a/libstdc++-v3/include/precompiled/stdc++.h b/libstdc++-v3/include/precompiled/stdc++.h
index 195377d..a4da234 100644
--- a/libstdc++-v3/include/precompiled/stdc++.h
+++ b/libstdc++-v3/include/precompiled/stdc++.h
@@ -105,7 +105,6 @@ 
 #include <mutex>
 #include <random>
 #include <ratio>
-#include <regex>
 #include <scoped_allocator>
 #include <system_error>
 #include <thread>
diff --git a/libstdc++-v3/include/std/regex b/libstdc++-v3/include/std/regex
index 907f5bb..3f5e5a1 100644
--- a/libstdc++-v3/include/std/regex
+++ b/libstdc++-v3/include/std/regex
@@ -35,6 +35,10 @@ 
 # include <bits/c++0x_warning.h>
 #else
 
+#ifndef _GLIBCXX_REGEX_NO_WARNING
+#warning The <regex> header is not implemented in versions older than GCC 4.9.0
+#endif
+
 #include <algorithm>
 #include <bitset>
 #include <functional>
diff --git a/libstdc++-v3/src/c++11/regex.cc b/libstdc++-v3/src/c++11/regex.cc
index b18afe2..8362dbc 100644
--- a/libstdc++-v3/src/c++11/regex.cc
+++ b/libstdc++-v3/src/c++11/regex.cc
@@ -22,6 +22,7 @@ 
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
+#define _GLIBCXX_REGEX_NO_WARNING
 #include <regex>
 
 namespace std _GLIBCXX_VISIBILITY(default)
diff --git a/libstdc++-v3/testsuite/17_intro/using_namespace_std_tr1_neg.cc b/libstdc++-v3/testsuite/17_intro/using_namespace_std_tr1_neg.cc
index 94d4140..c07f50a 100644
--- a/libstdc++-v3/testsuite/17_intro/using_namespace_std_tr1_neg.cc
+++ b/libstdc++-v3/testsuite/17_intro/using_namespace_std_tr1_neg.cc
@@ -45,7 +45,6 @@ 
 #include <ostream>
 #include <queue>
 #include <random>
-#include <regex>
 #include <set>
 #include <sstream>
 #include <stack>
@@ -66,4 +65,4 @@  namespace gnu
   using namespace std::tr1;  // { dg-error "is not a namespace-name" }
 }
 
-// { dg-error "expected namespace-name before" "" { target *-*-* } 66 } 
+// { dg-error "expected namespace-name before" "" { target *-*-* } 65 }