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]

Re: [v3] missed explicit bool conversion cleanups


> As pointed out by Gaby as part of the constexpr work. I did a bunch of
> these fixes after Jason's initial implementation. However, these were
> found by compiling the "src" directory of libstdc++ with
> CXXFLAGS="-std=gnu++0x -Wfatal-errors"

Actually....

This re-arranges some of the TR1/C++0x source files such that TR1 files
have the right definitions, even in the presence of -std=gnu++0x. So,
the libstdc++ build with CXXFLAGS="-std=gnu++0x" will link correctly,
and is usable although fails ABI checks.

The ABI fails are mostly C++0x added symbols that are not version
mapped correctly. Ie, complex::[imag|real], numeric_limits::inifinity,
chrono, common_type, basic_*stream::(string ctors), initializer_list*,
etc. This is unsurprising.

tested x86_64/linux

-benjamin
2009-08-10  Benjamin Kosnik  <bkoz@redhat.com>

	* src/hashtable.cc: Just definitions.
	* src/hashtable_c++0x.cc: Compile C++0x versions.
	* src/hash.cc: Same.
	* src/hash_c++0x.cc: Same.
	src/hash_tr1.cc: Compile TR1 versions.
	src/hashtable_tr1.cc: Same.

	* src/limits_c++0x.cc: Sync build error handling.

	* src/Makefile.am (sources): Change hash.cc to hash_tr1.cc,
	hashtable.cc to hashtable_tr1.cc.
	* src/Makefile.in: Regenerate.

Index: src/hashtable_c++0x.cc
===================================================================
--- src/hashtable_c++0x.cc	(revision 150640)
+++ src/hashtable_c++0x.cc	(working copy)
@@ -22,4 +22,11 @@
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# error "hashtable_c++0x.cc must be compiled with -std=gnu++0x"
+#endif
+
+namespace std
+{
 #include "hashtable.cc"
+}
Index: src/hashtable.cc
===================================================================
--- src/hashtable.cc	(revision 150640)
+++ src/hashtable.cc	(working copy)
@@ -22,18 +22,6 @@
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
-#  define _GLIBCXX_BEGIN_NAMESPACE_TR1 
-#  define _GLIBCXX_END_NAMESPACE_TR1 
-#else
-#  define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
-#  define _GLIBCXX_END_NAMESPACE_TR1 }
-#endif
-
-namespace std
-{ 
-_GLIBCXX_BEGIN_NAMESPACE_TR1
-
 namespace __detail
 {
   extern const unsigned long __prime_list[] = // 256 + 1 or 256 + 48 + 1
@@ -101,6 +89,3 @@
 #endif
   };
 } // namespace __detail
-
-_GLIBCXX_END_NAMESPACE_TR1
-}
Index: src/hashtable_tr1.cc
===================================================================
--- src/hashtable_tr1.cc	(revision 0)
+++ src/hashtable_tr1.cc	(revision 0)
@@ -0,0 +1,31 @@
+// std::__detail definitions -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+namespace std
+{
+  namespace tr1 
+  {
+#include "hashtable.cc"
+  }
+}
Index: src/hash_c++0x.cc
===================================================================
--- src/hash_c++0x.cc	(revision 150640)
+++ src/hash_c++0x.cc	(working copy)
@@ -22,11 +22,20 @@
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
-#include "hash.cc"
+#include <cstddef>
+#include <string>
+#include <cmath>
+#include <functional>
 #include <system_error>
 
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# error "hash_c++0x.cc must be compiled with -std=gnu++0x"
+#endif
+
 namespace std
 {
+#include "hash.cc"
+
   template<>
     size_t
     hash<error_code>::operator()(error_code __e) const
Index: src/hash.cc
===================================================================
--- src/hash.cc	(revision 150640)
+++ src/hash.cc	(working copy)
@@ -22,24 +22,6 @@
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
-#include <cstddef>
-#include <string>
-#include <cmath>
-
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
-#include <functional>
-#  define _GLIBCXX_BEGIN_NAMESPACE_TR1 
-#  define _GLIBCXX_END_NAMESPACE_TR1 
-#else
-#include <tr1/functional>
-#  define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
-#  define _GLIBCXX_END_NAMESPACE_TR1 }
-#endif
-
-namespace std
-{
-_GLIBCXX_BEGIN_NAMESPACE_TR1
-
   // For long double, careful with random padding bits (e.g., on x86,
   // 10 bytes -> 12 bytes) and resort to frexp.
   template<>
@@ -98,6 +80,3 @@
     }
 #endif
 #endif
-
-_GLIBCXX_END_NAMESPACE_TR1
-}
Index: src/hash_tr1.cc
===================================================================
--- src/hash_tr1.cc	(revision 0)
+++ src/hash_tr1.cc	(revision 0)
@@ -0,0 +1,36 @@
+// std::hash definitions -*- C++ -*-
+
+// Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+#include <cstddef>
+#include <string>
+#include <cmath>
+#include <tr1/functional>
+
+namespace std
+{
+  namespace tr1 
+  {
+#include "hash.cc"
+  }
+}
Index: src/limits_c++0x.cc
===================================================================
--- src/limits_c++0x.cc	(revision 150640)
+++ src/limits_c++0x.cc	(working copy)
@@ -24,6 +24,10 @@
 
 #include <limits>
 
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+# error "limits_c++0x.cc must be compiled with -std=gnu++0x"
+#endif
+
 namespace std
 {
   // char16_t
Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 150640)
+++ src/Makefile.am	(working copy)
@@ -144,10 +144,10 @@
 	ctype.cc \
 	debug.cc \
 	functexcept.cc \
-	hash.cc \
+	hash_tr1.cc \
 	hash_c++0x.cc \
 	globals_io.cc \
-	hashtable.cc \
+	hashtable_tr1.cc \
 	hashtable_c++0x.cc \
 	ios.cc \
 	ios_failure.cc \

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