This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [patch] c++/65046 Use abi-tag to fix building with -Werror=abi-tag


On 18/03/15 18:16 +0000, Jonathan Wakely wrote:
This adds the abi_tag attribute in a few places it's missing, so that
-Werror=abi-tag builds will work after Jason's upcoming patches to
make functions inherit the tag from their return type.

Jason suggested using an inline namespace instead of tagging types, so
this adds __gnu_cxx::__cxx11, similar to the existing std::__cxx11.

Tested x86_64-linux, committed to trunk.

commit de4ceb0c3bc9cc833c044683c9d94ccb60812359
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Mar 20 10:49:18 2015 +0000

    	* include/bits/c++config (__gnu_cxx::__cxx11): Define new namespace.
    	* include/ext/codecvt_specializations.h (encoding_state,
    	encoding_char_traits): Remove abi-tag and use inline namespace.
    	* testsuite/ext/profile/mutex_extensions_neg.cc: Adjust dg-error line.

diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index eebe34c..ae3065f 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -217,6 +217,10 @@ namespace std
 {
   inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
 }
+namespace __gnu_cxx
+{
+  inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
+}
 # define _GLIBCXX_NAMESPACE_CXX11 __cxx11::
 # define _GLIBCXX_BEGIN_NAMESPACE_CXX11 namespace __cxx11 {
 # define _GLIBCXX_END_NAMESPACE_CXX11 }
diff --git a/libstdc++-v3/include/ext/codecvt_specializations.h b/libstdc++-v3/include/ext/codecvt_specializations.h
index d9f6630..34e90bd 100644
--- a/libstdc++-v3/include/ext/codecvt_specializations.h
+++ b/libstdc++-v3/include/ext/codecvt_specializations.h
@@ -41,13 +41,14 @@
 
 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
 {
+_GLIBCXX_BEGIN_NAMESPACE_CXX11
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   /// Extension to use iconv for dealing with character encodings.
   // This includes conversions and comparisons between various character
   // sets.  This object encapsulates data that may need to be shared between
   // char_traits, codecvt and ctype.
-  class _GLIBCXX_DEFAULT_ABI_TAG encoding_state
+  class encoding_state
   {
   public:
     // Types: 
@@ -207,7 +208,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   // associated fpos<encoding_state> for the position type, all other
   // bits equivalent to the required char_traits instantiations.
   template<typename _CharT>
-    struct _GLIBCXX_DEFAULT_ABI_TAG encoding_char_traits
+    struct encoding_char_traits
     : public std::char_traits<_CharT>
     {
       typedef encoding_state				state_type;
@@ -215,6 +216,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     };
 
 _GLIBCXX_END_NAMESPACE_VERSION
+_GLIBCXX_END_NAMESPACE_CXX11
 } // namespace
 
 
diff --git a/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc b/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc
index d7a0c56..dd19f14 100644
--- a/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc
+++ b/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc
@@ -25,4 +25,4 @@
 
 #include <vector>
 
-// { dg-error "multiple inlined namespaces" "" { target *-*-* } 318 }
+// { dg-error "multiple inlined namespaces" "" { target *-*-* } 322 }

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