]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/include/bits/locale_facets.h
Update copyright years in libstdc++-v3/
[thirdparty/gcc.git] / libstdc++-v3 / include / bits / locale_facets.h
index b67c6a02d6ecd859fa3c3e54c47e1d6041cdd8cb..453bbedbd62c3b9e1b6ea0ef2a0a0ab7784de1a3 100644 (file)
@@ -1,8 +1,6 @@
 // Locale support -*- C++ -*-
 
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-// 2006, 2007, 2008, 2009, 2010
-// Free Software Foundation, Inc.
+// Copyright (C) 1997-2014 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
@@ -24,9 +22,9 @@
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
-/** @file locale_facets.h
+/** @file bits/locale_facets.h
  *  This is an internal header file, included by other library headers.
- *  You should not attempt to use it directly.
+ *  Do not attempt to use it directly. @headername{locale}
  */
 
 //
@@ -40,7 +38,7 @@
 
 #include <cwctype>     // For wctype_t
 #include <cctype>
-#include <bits/ctype_base.h>   
+#include <bits/ctype_base.h>
 #include <iosfwd>
 #include <bits/ios_base.h>  // For ios_base, ios_base::iostate
 #include <streambuf>
@@ -49,7 +47,9 @@
 #include <ext/numeric_traits.h>
 #include <bits/streambuf_iterator.h>
 
-_GLIBCXX_BEGIN_NAMESPACE(std)
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   // NB: Don't instantiate required wchar_t facets if no wchar_t support.
 #ifdef _GLIBCXX_USE_WCHAR_T
@@ -150,12 +150,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       /**
        *  @brief  Test char_type classification.
        *
-       *  This function finds a mask M for @a c and compares it to mask @a m.
-       *  It does so by returning the value of ctype<char_type>::do_is().
+       *  This function finds a mask M for @a __c and compares it to
+       *  mask @a __m.  It does so by returning the value of
+       *  ctype<char_type>::do_is().
        *
-       *  @param c  The char_type to compare the mask of.
-       *  @param m  The mask to compare against.
-       *  @return  (M & m) != 0.
+       *  @param __c  The char_type to compare the mask of.
+       *  @param __m  The mask to compare against.
+       *  @return  (M & __m) != 0.
       */
       bool
       is(mask __m, char_type __c) const
@@ -169,10 +170,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  as the char array.  It does so by returning the value of
        *  ctype<char_type>::do_is().
        *
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @param vec  Pointer to an array of mask storage.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __vec  Pointer to an array of mask storage.
+       *  @return  @a __hi.
       */
       const char_type*
       is(const char_type *__lo, const char_type *__hi, mask *__vec) const
@@ -185,10 +186,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  [lo,hi) for which is(m,c) is true.  It does so by returning
        *  ctype<char_type>::do_scan_is().
        *
-       *  @param m  The mask to compare against.
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @return  Pointer to matching char_type if found, else @a hi.
+       *  @param __m  The mask to compare against.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  Pointer to matching char_type if found, else @a __hi.
       */
       const char_type*
       scan_is(mask __m, const char_type* __lo, const char_type* __hi) const
@@ -201,10 +202,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  [lo,hi) for which is(m,c) is false.  It does so by returning
        *  ctype<char_type>::do_scan_not().
        *
-       *  @param m  The mask to compare against.
-       *  @param lo  Pointer to first char in range.
-       *  @param hi  Pointer to end of range.
-       *  @return  Pointer to non-matching char if found, else @a hi.
+       *  @param __m  The mask to compare against.
+       *  @param __lo  Pointer to first char in range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  Pointer to non-matching char if found, else @a __hi.
       */
       const char_type*
       scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
@@ -217,8 +218,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  If not possible (for example, '2'), returns the argument.  It does
        *  so by returning ctype<char_type>::do_toupper().
        *
-       *  @param c  The char_type to convert.
-       *  @return  The uppercase char_type if convertible, else @a c.
+       *  @param __c  The char_type to convert.
+       *  @return  The uppercase char_type if convertible, else @a __c.
       */
       char_type
       toupper(char_type __c) const
@@ -231,9 +232,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  uppercase if possible.  Other elements remain untouched.  It does so
        *  by returning ctype<char_type>:: do_toupper(lo, hi).
        *
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  @a __hi.
       */
       const char_type*
       toupper(char_type *__lo, const char_type* __hi) const
@@ -246,8 +247,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  not possible (for example, '2'), returns the argument.  It does so
        *  by returning ctype<char_type>::do_tolower(c).
        *
-       *  @param c  The char_type to convert.
-       *  @return  The lowercase char_type if convertible, else @a c.
+       *  @param __c  The char_type to convert.
+       *  @return  The lowercase char_type if convertible, else @a __c.
       */
       char_type
       tolower(char_type __c) const
@@ -256,13 +257,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       /**
        *  @brief  Convert array to lowercase.
        *
-       *  This function converts each char_type in the range [lo,hi) to
+       *  This function converts each char_type in the range [__lo,__hi) to
        *  lowercase if possible.  Other elements remain untouched.  It does so
-       *  by returning ctype<char_type>:: do_tolower(lo, hi).
+       *  by returning ctype<char_type>:: do_tolower(__lo, __hi).
        *
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  @a __hi.
       */
       const char_type*
       tolower(char_type* __lo, const char_type* __hi) const
@@ -278,7 +279,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  Note: this is not what you want for codepage conversions.  See
        *  codecvt for that.
        *
-       *  @param c  The char to convert.
+       *  @param __c  The char to convert.
        *  @return  The converted char_type.
       */
       char_type
@@ -295,10 +296,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  Note: this is not what you want for codepage conversions.  See
        *  codecvt for that.
        *
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @param to  Pointer to the destination array.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __to  Pointer to the destination array.
+       *  @return  @a __hi.
       */
       const char*
       widen(const char* __lo, const char* __hi, char_type* __to) const
@@ -310,13 +311,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  This function converts the char_type to char using the simplest
        *  reasonable transformation.  If the conversion fails, dfault is
        *  returned instead.  It does so by returning
-       *  ctype<char_type>::do_narrow(c).
+       *  ctype<char_type>::do_narrow(__c).
        *
        *  Note: this is not what you want for codepage conversions.  See
        *  codecvt for that.
        *
-       *  @param c  The char_type to convert.
-       *  @param dfault  Char to return if conversion fails.
+       *  @param __c  The char_type to convert.
+       *  @param __dfault  Char to return if conversion fails.
        *  @return  The converted char.
       */
       char
@@ -330,20 +331,20 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  simplest reasonable transformation and writes the results to the
        *  destination array.  For any char_type in the input that cannot be
        *  converted, @a dfault is used instead.  It does so by returning
-       *  ctype<char_type>::do_narrow(lo, hi, dfault, to).
+       *  ctype<char_type>::do_narrow(__lo, __hi, __dfault, __to).
        *
        *  Note: this is not what you want for codepage conversions.  See
        *  codecvt for that.
        *
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @param dfault  Char to use if conversion fails.
-       *  @param to  Pointer to the destination array.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __dfault  Char to use if conversion fails.
+       *  @param __to  Pointer to the destination array.
+       *  @return  @a __hi.
       */
       const char_type*
       narrow(const char_type* __lo, const char_type* __hi,
-             char __dfault, char *__to) const
+             char __dfault, char__to) const
       { return this->do_narrow(__lo, __hi, __dfault, __to); }
 
     protected:
@@ -362,9 +363,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  classifying.  do_is() must always return the same result for the
        *  same input.
        *
-       *  @param c  The char_type to find the mask of.
-       *  @param m  The mask to compare against.
-       *  @return  (M & m) != 0.
+       *  @param __c  The char_type to find the mask of.
+       *  @param __m  The mask to compare against.
+       *  @return  (M & __m) != 0.
       */
       virtual bool
       do_is(mask __m, char_type __c) const = 0;
@@ -380,10 +381,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  classifying.  do_is() must always return the same result for the
        *  same input.
        *
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @param vec  Pointer to an array of mask storage.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __vec  Pointer to an array of mask storage.
+       *  @return  @a __hi.
       */
       virtual const char_type*
       do_is(const char_type* __lo, const char_type* __hi,
@@ -393,16 +394,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  @brief  Find char_type matching mask
        *
        *  This function searches for and returns the first char_type c in
-       *  [lo,hi) for which is(m,c) is true.
+       *  [__lo,__hi) for which is(__m,c) is true.
        *
        *  do_scan_is() is a hook for a derived facet to change the behavior of
        *  match searching.  do_is() must always return the same result for the
        *  same input.
        *
-       *  @param m  The mask to compare against.
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @return  Pointer to a matching char_type if found, else @a hi.
+       *  @param __m  The mask to compare against.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  Pointer to a matching char_type if found, else @a __hi.
       */
       virtual const char_type*
       do_scan_is(mask __m, const char_type* __lo,
@@ -418,10 +419,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  match searching.  do_is() must always return the same result for the
        *  same input.
        *
-       *  @param m  The mask to compare against.
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @return  Pointer to a non-matching char_type if found, else @a hi.
+       *  @param __m  The mask to compare against.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  Pointer to a non-matching char_type if found, else @a __hi.
       */
       virtual const char_type*
       do_scan_not(mask __m, const char_type* __lo,
@@ -438,25 +439,25 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  uppercasing.  do_toupper() must always return the same result for
        *  the same input.
        *
-       *  @param c  The char_type to convert.
-       *  @return  The uppercase char_type if convertible, else @a c.
+       *  @param __c  The char_type to convert.
+       *  @return  The uppercase char_type if convertible, else @a __c.
       */
       virtual char_type
-      do_toupper(char_type) const = 0;
+      do_toupper(char_type __c) const = 0;
 
       /**
        *  @brief  Convert array to uppercase.
        *
-       *  This virtual function converts each char_type in the range [lo,hi)
+       *  This virtual function converts each char_type in the range [__lo,__hi)
        *  to uppercase if possible.  Other elements remain untouched.
        *
        *  do_toupper() is a hook for a derived facet to change the behavior of
        *  uppercasing.  do_toupper() must always return the same result for
        *  the same input.
        *
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  @a __hi.
       */
       virtual const char_type*
       do_toupper(char_type* __lo, const char_type* __hi) const = 0;
@@ -471,25 +472,25 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  lowercasing.  do_tolower() must always return the same result for
        *  the same input.
        *
-       *  @param c  The char_type to convert.
-       *  @return  The lowercase char_type if convertible, else @a c.
+       *  @param __c  The char_type to convert.
+       *  @return  The lowercase char_type if convertible, else @a __c.
       */
       virtual char_type
-      do_tolower(char_type) const = 0;
+      do_tolower(char_type __c) const = 0;
 
       /**
        *  @brief  Convert array to lowercase.
        *
-       *  This virtual function converts each char_type in the range [lo,hi)
+       *  This virtual function converts each char_type in the range [__lo,__hi)
        *  to lowercase if possible.  Other elements remain untouched.
        *
        *  do_tolower() is a hook for a derived facet to change the behavior of
        *  lowercasing.  do_tolower() must always return the same result for
        *  the same input.
        *
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  @a __hi.
       */
       virtual const char_type*
       do_tolower(char_type* __lo, const char_type* __hi) const = 0;
@@ -507,11 +508,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  Note: this is not what you want for codepage conversions.  See
        *  codecvt for that.
        *
-       *  @param c  The char to convert.
+       *  @param __c  The char to convert.
        *  @return  The converted char_type
       */
       virtual char_type
-      do_widen(char) const = 0;
+      do_widen(char __c) const = 0;
 
       /**
        *  @brief  Widen char array
@@ -526,14 +527,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  Note: this is not what you want for codepage conversions.  See
        *  codecvt for that.
        *
-       *  @param lo  Pointer to start range.
-       *  @param hi  Pointer to end of range.
-       *  @param to  Pointer to the destination array.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to start range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __to  Pointer to the destination array.
+       *  @return  @a __hi.
       */
       virtual const char*
-      do_widen(const char* __lo, const char* __hi,
-              char_type* __dest) const = 0;
+      do_widen(const char* __lo, const char* __hi, char_type* __to) const = 0;
 
       /**
        *  @brief  Narrow char_type to char
@@ -549,20 +549,21 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  Note: this is not what you want for codepage conversions.  See
        *  codecvt for that.
        *
-       *  @param c  The char_type to convert.
-       *  @param dfault  Char to return if conversion fails.
+       *  @param __c  The char_type to convert.
+       *  @param __dfault  Char to return if conversion fails.
        *  @return  The converted char.
       */
       virtual char
-      do_narrow(char_type, char __dfault) const = 0;
+      do_narrow(char_type __c, char __dfault) const = 0;
 
       /**
        *  @brief  Narrow char_type array to char
        *
-       *  This virtual function converts each char_type in the range [lo,hi) to
-       *  char using the simplest reasonable transformation and writes the
-       *  results to the destination array.  For any element in the input that
-       *  cannot be converted, @a dfault is used instead.
+       *  This virtual function converts each char_type in the range
+       *  [__lo,__hi) to char using the simplest reasonable
+       *  transformation and writes the results to the destination
+       *  array.  For any element in the input that cannot be
+       *  converted, @a __dfault is used instead.
        *
        *  do_narrow() is a hook for a derived facet to change the behavior of
        *  narrowing.  do_narrow() must always return the same result for the
@@ -571,15 +572,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  Note: this is not what you want for codepage conversions.  See
        *  codecvt for that.
        *
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @param dfault  Char to use if conversion fails.
-       *  @param to  Pointer to the destination array.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __dfault  Char to use if conversion fails.
+       *  @param __to  Pointer to the destination array.
+       *  @return  @a __hi.
       */
       virtual const char_type*
       do_narrow(const char_type* __lo, const char_type* __hi,
-               char __dfault, char* __dest) const = 0;
+               char __dfault, char* __to) const = 0;
     };
 
   /**
@@ -587,7 +588,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
    *  @ingroup locales
    *
    *  This template class defines classification and conversion functions for
-   *  character sets.  It wraps <cctype> functionality.  Ctype gets used by
+   *  character sets.  It wraps cctype functionality.  Ctype gets used by
    *  streams for many I/O operations.
    *
    *  This template provides the protected virtual functions the developer
@@ -654,7 +655,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 
       virtual const char_type*
       do_narrow(const char_type* __lo, const char_type* __hi,
-               char __dfault, char* __dest) const;
+               char __dfault, char* __to) const;
     };
 
   template<typename _CharT>
@@ -701,10 +702,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *
        *  This is the constructor provided by the standard.
        *
-       *  @param table If non-zero, table is used as the per-char mask.
+       *  @param __table If non-zero, table is used as the per-char mask.
        *               Else classic_table() is used.
-       *  @param del   If true, passes ownership of table to this facet.
-       *  @param refs  Passed to the base facet class.
+       *  @param __del   If true, passes ownership of table to this facet.
+       *  @param __refs  Passed to the base facet class.
       */
       explicit
       ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0);
@@ -714,10 +715,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *
        *  This constructor is used to construct the initial C locale facet.
        *
-       *  @param cloc  Handle to C locale data.
-       *  @param table If non-zero, table is used as the per-char mask.
-       *  @param del   If true, passes ownership of table to this facet.
-       *  @param refs  Passed to the base facet class.
+       *  @param __cloc  Handle to C locale data.
+       *  @param __table If non-zero, table is used as the per-char mask.
+       *  @param __del   If true, passes ownership of table to this facet.
+       *  @param __refs  Passed to the base facet class.
       */
       explicit
       ctype(__c_locale __cloc, const mask* __table = 0, bool __del = false,
@@ -726,11 +727,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       /**
        *  @brief  Test char classification.
        *
-       *  This function compares the mask table[c] to @a m.
+       *  This function compares the mask table[c] to @a __m.
        *
-       *  @param c  The char to compare the mask of.
-       *  @param m  The mask to compare against.
-       *  @return  True if m & table[c] is true, false otherwise.
+       *  @param __c  The char to compare the mask of.
+       *  @param __m  The mask to compare against.
+       *  @return  True if __m & table[__c] is true, false otherwise.
       */
       inline bool
       is(mask __m, char __c) const;
@@ -742,10 +743,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  successively writes it to vec.  vec must have as many elements as
        *  the char array.
        *
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @param vec  Pointer to an array of mask storage.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __vec  Pointer to an array of mask storage.
+       *  @return  @a __hi.
       */
       inline const char*
       is(const char* __lo, const char* __hi, mask* __vec) const;
@@ -756,10 +757,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  This function searches for and returns the first char in [lo,hi) for
        *  which is(m,char) is true.
        *
-       *  @param m  The mask to compare against.
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @return  Pointer to a matching char if found, else @a hi.
+       *  @param __m  The mask to compare against.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  Pointer to a matching char if found, else @a __hi.
       */
       inline const char*
       scan_is(mask __m, const char* __lo, const char* __hi) const;
@@ -768,12 +769,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  @brief  Find char not matching a mask
        *
        *  This function searches for and returns a pointer to the first char
-       *  in [lo,hi) for which is(m,char) is false.
+       *  in [__lo,__hi) for which is(m,char) is false.
        *
-       *  @param m  The mask to compare against.
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @return  Pointer to a non-matching char if found, else @a hi.
+       *  @param __m  The mask to compare against.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  Pointer to a non-matching char if found, else @a __hi.
       */
       inline const char*
       scan_not(mask __m, const char* __lo, const char* __hi) const;
@@ -787,8 +788,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  toupper() acts as if it returns ctype<char>::do_toupper(c).
        *  do_toupper() must always return the same result for the same input.
        *
-       *  @param c  The char to convert.
-       *  @return  The uppercase char if convertible, else @a c.
+       *  @param __c  The char to convert.
+       *  @return  The uppercase char if convertible, else @a __c.
       */
       char_type
       toupper(char_type __c) const
@@ -797,15 +798,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       /**
        *  @brief  Convert array to uppercase.
        *
-       *  This function converts each char in the range [lo,hi) to uppercase
+       *  This function converts each char in the range [__lo,__hi) to uppercase
        *  if possible.  Other chars remain untouched.
        *
-       *  toupper() acts as if it returns ctype<char>:: do_toupper(lo, hi).
+       *  toupper() acts as if it returns ctype<char>:: do_toupper(__lo, __hi).
        *  do_toupper() must always return the same result for the same input.
        *
-       *  @param lo  Pointer to first char in range.
-       *  @param hi  Pointer to end of range.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to first char in range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  @a __hi.
       */
       const char_type*
       toupper(char_type *__lo, const char_type* __hi) const
@@ -817,11 +818,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  This function converts the char argument to lowercase if possible.
        *  If not possible (for example, '2'), returns the argument.
        *
-       *  tolower() acts as if it returns ctype<char>::do_tolower(c).
+       *  tolower() acts as if it returns ctype<char>::do_tolower(__c).
        *  do_tolower() must always return the same result for the same input.
        *
-       *  @param c  The char to convert.
-       *  @return  The lowercase char if convertible, else @a c.
+       *  @param __c  The char to convert.
+       *  @return  The lowercase char if convertible, else @a __c.
       */
       char_type
       tolower(char_type __c) const
@@ -833,12 +834,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  This function converts each char in the range [lo,hi) to lowercase
        *  if possible.  Other chars remain untouched.
        *
-       *  tolower() acts as if it returns ctype<char>:: do_tolower(lo, hi).
+       *  tolower() acts as if it returns ctype<char>:: do_tolower(__lo, __hi).
        *  do_tolower() must always return the same result for the same input.
        *
-       *  @param lo  Pointer to first char in range.
-       *  @param hi  Pointer to end of range.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to first char in range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  @a __hi.
       */
       const char_type*
       tolower(char_type* __lo, const char_type* __hi) const
@@ -857,7 +858,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  Note: this is not what you want for codepage conversions.  See
        *  codecvt for that.
        *
-       *  @param c  The char to convert.
+       *  @param __c  The char to convert.
        *  @return  The converted character.
       */
       char_type
@@ -882,10 +883,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  Note: this is not what you want for codepage conversions.  See
        *  codecvt for that.
        *
-       *  @param lo  Pointer to first char in range.
-       *  @param hi  Pointer to end of range.
-       *  @param to  Pointer to the destination array.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to first char in range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __to  Pointer to the destination array.
+       *  @return  @a __hi.
       */
       const char*
       widen(const char* __lo, const char* __hi, char_type* __to) const
@@ -914,8 +915,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  Note: this is not what you want for codepage conversions.  See
        *  codecvt for that.
        *
-       *  @param c  The char to convert.
-       *  @param dfault  Char to return if conversion fails.
+       *  @param __c  The char to convert.
+       *  @param __dfault  Char to return if conversion fails.
        *  @return  The converted character.
       */
       char
@@ -945,15 +946,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  Note: this is not what you want for codepage conversions.  See
        *  codecvt for that.
        *
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @param dfault  Char to use if conversion fails.
-       *  @param to  Pointer to the destination array.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __dfault  Char to use if conversion fails.
+       *  @param __to  Pointer to the destination array.
+       *  @return  @a __hi.
       */
       const char_type*
       narrow(const char_type* __lo, const char_type* __hi,
-            char __dfault, char *__to) const
+            char __dfault, char__to) const
       {
        if (__builtin_expect(_M_narrow_ok == 1, true))
          {
@@ -997,11 +998,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  uppercasing.  do_toupper() must always return the same result for
        *  the same input.
        *
-       *  @param c  The char to convert.
-       *  @return  The uppercase char if convertible, else @a c.
+       *  @param __c  The char to convert.
+       *  @return  The uppercase char if convertible, else @a __c.
       */
       virtual char_type
-      do_toupper(char_type) const;
+      do_toupper(char_type __c) const;
 
       /**
        *  @brief  Convert array to uppercase.
@@ -1013,9 +1014,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  uppercasing.  do_toupper() must always return the same result for
        *  the same input.
        *
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  @a __hi.
       */
       virtual const char_type*
       do_toupper(char_type* __lo, const char_type* __hi) const;
@@ -1030,11 +1031,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  lowercasing.  do_tolower() must always return the same result for
        *  the same input.
        *
-       *  @param c  The char to convert.
-       *  @return  The lowercase char if convertible, else @a c.
+       *  @param __c  The char to convert.
+       *  @return  The lowercase char if convertible, else @a __c.
       */
       virtual char_type
-      do_tolower(char_type) const;
+      do_tolower(char_type __c) const;
 
       /**
        *  @brief  Convert array to lowercase.
@@ -1046,9 +1047,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  lowercasing.  do_tolower() must always return the same result for
        *  the same input.
        *
-       *  @param lo  Pointer to first char in range.
-       *  @param hi  Pointer to end of range.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to first char in range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  @a __hi.
       */
       virtual const char_type*
       do_tolower(char_type* __lo, const char_type* __hi) const;
@@ -1067,7 +1068,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  Note: this is not what you want for codepage conversions.  See
        *  codecvt for that.
        *
-       *  @param c  The char to convert.
+       *  @param __c  The char to convert.
        *  @return  The converted character.
       */
       virtual char_type
@@ -1088,15 +1089,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  Note: this is not what you want for codepage conversions.  See
        *  codecvt for that.
        *
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @param to  Pointer to the destination array.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __to  Pointer to the destination array.
+       *  @return  @a __hi.
       */
       virtual const char*
-      do_widen(const char* __lo, const char* __hi, char_type* __dest) const
+      do_widen(const char* __lo, const char* __hi, char_type* __to) const
       {
-       __builtin_memcpy(__dest, __lo, __hi - __lo);
+       __builtin_memcpy(__to, __lo, __hi - __lo);
        return __hi;
       }
 
@@ -1115,12 +1116,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  Note: this is not what you want for codepage conversions.  See
        *  codecvt for that.
        *
-       *  @param c  The char to convert.
-       *  @param dfault  Char to return if conversion fails.
+       *  @param __c  The char to convert.
+       *  @param __dfault  Char to return if conversion fails.
        *  @return  The converted char.
       */
       virtual char
-      do_narrow(char_type __c, char) const
+      do_narrow(char_type __c, char __dfault) const
       { return __c; }
 
       /**
@@ -1139,17 +1140,17 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  Note: this is not what you want for codepage conversions.  See
        *  codecvt for that.
        *
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @param dfault  Char to use if conversion fails.
-       *  @param to  Pointer to the destination array.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __dfault  Char to use if conversion fails.
+       *  @param __to  Pointer to the destination array.
+       *  @return  @a __hi.
       */
       virtual const char_type*
       do_narrow(const char_type* __lo, const char_type* __hi,
-               char, char* __dest) const
+               char __dfault, char* __to) const
       {
-       __builtin_memcpy(__dest, __lo, __hi - __lo);
+       __builtin_memcpy(__to, __lo, __hi - __lo);
        return __hi;
       }
 
@@ -1201,7 +1202,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *
        *  This is the constructor provided by the standard.
        *
-       *  @param refs  Passed to the base facet class.
+       *  @param __refs  Passed to the base facet class.
       */
       explicit
       ctype(size_t __refs = 0);
@@ -1211,8 +1212,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *
        *  This constructor is used to construct the initial C locale facet.
        *
-       *  @param cloc  Handle to C locale data.
-       *  @param refs  Passed to the base facet class.
+       *  @param __cloc  Handle to C locale data.
+       *  @param __refs  Passed to the base facet class.
       */
       explicit
       ctype(__c_locale __cloc, size_t __refs = 0);
@@ -1234,9 +1235,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  classifying.  do_is() must always return the same result for the
        *  same input.
        *
-       *  @param c  The wchar_t to find the mask of.
-       *  @param m  The mask to compare against.
-       *  @return  (M & m) != 0.
+       *  @param __c  The wchar_t to find the mask of.
+       *  @param __m  The mask to compare against.
+       *  @return  (M & __m) != 0.
       */
       virtual bool
       do_is(mask __m, char_type __c) const;
@@ -1252,10 +1253,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  classifying.  do_is() must always return the same result for the
        *  same input.
        *
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @param vec  Pointer to an array of mask storage.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __vec  Pointer to an array of mask storage.
+       *  @return  @a __hi.
       */
       virtual const char_type*
       do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
@@ -1264,16 +1265,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  @brief  Find wchar_t matching mask
        *
        *  This function searches for and returns the first wchar_t c in
-       *  [lo,hi) for which is(m,c) is true.
+       *  [__lo,__hi) for which is(__m,c) is true.
        *
        *  do_scan_is() is a hook for a derived facet to change the behavior of
        *  match searching.  do_is() must always return the same result for the
        *  same input.
        *
-       *  @param m  The mask to compare against.
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @return  Pointer to a matching wchar_t if found, else @a hi.
+       *  @param __m  The mask to compare against.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  Pointer to a matching wchar_t if found, else @a __hi.
       */
       virtual const char_type*
       do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
@@ -1282,16 +1283,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  @brief  Find wchar_t not matching mask
        *
        *  This function searches for and returns a pointer to the first
-       *  wchar_t c of [lo,hi) for which is(m,c) is false.
+       *  wchar_t c of [__lo,__hi) for which is(__m,c) is false.
        *
        *  do_scan_is() is a hook for a derived facet to change the behavior of
        *  match searching.  do_is() must always return the same result for the
        *  same input.
        *
-       *  @param m  The mask to compare against.
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @return  Pointer to a non-matching wchar_t if found, else @a hi.
+       *  @param __m  The mask to compare against.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  Pointer to a non-matching wchar_t if found, else @a __hi.
       */
       virtual const char_type*
       do_scan_not(mask __m, const char_type* __lo,
@@ -1307,11 +1308,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  uppercasing.  do_toupper() must always return the same result for
        *  the same input.
        *
-       *  @param c  The wchar_t to convert.
-       *  @return  The uppercase wchar_t if convertible, else @a c.
+       *  @param __c  The wchar_t to convert.
+       *  @return  The uppercase wchar_t if convertible, else @a __c.
       */
       virtual char_type
-      do_toupper(char_type) const;
+      do_toupper(char_type __c) const;
 
       /**
        *  @brief  Convert array to uppercase.
@@ -1323,9 +1324,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  uppercasing.  do_toupper() must always return the same result for
        *  the same input.
        *
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  @a __hi.
       */
       virtual const char_type*
       do_toupper(char_type* __lo, const char_type* __hi) const;
@@ -1340,11 +1341,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  lowercasing.  do_tolower() must always return the same result for
        *  the same input.
        *
-       *  @param c  The wchar_t to convert.
-       *  @return  The lowercase wchar_t if convertible, else @a c.
+       *  @param __c  The wchar_t to convert.
+       *  @return  The lowercase wchar_t if convertible, else @a __c.
       */
       virtual char_type
-      do_tolower(char_type) const;
+      do_tolower(char_type __c) const;
 
       /**
        *  @brief  Convert array to lowercase.
@@ -1356,9 +1357,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  lowercasing.  do_tolower() must always return the same result for
        *  the same input.
        *
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @return  @a __hi.
       */
       virtual const char_type*
       do_tolower(char_type* __lo, const char_type* __hi) const;
@@ -1377,11 +1378,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  Note: this is not what you want for codepage conversions.  See
        *  codecvt for that.
        *
-       *  @param c  The char to convert.
+       *  @param __c  The char to convert.
        *  @return  The converted wchar_t.
       */
       virtual char_type
-      do_widen(char) const;
+      do_widen(char __c) const;
 
       /**
        *  @brief  Widen char array to wchar_t array
@@ -1397,13 +1398,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  Note: this is not what you want for codepage conversions.  See
        *  codecvt for that.
        *
-       *  @param lo  Pointer to start range.
-       *  @param hi  Pointer to end of range.
-       *  @param to  Pointer to the destination array.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to start range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __to  Pointer to the destination array.
+       *  @return  @a __hi.
       */
       virtual const char*
-      do_widen(const char* __lo, const char* __hi, char_type* __dest) const;
+      do_widen(const char* __lo, const char* __hi, char_type* __to) const;
 
       /**
        *  @brief  Narrow wchar_t to char
@@ -1421,12 +1422,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  Note: this is not what you want for codepage conversions.  See
        *  codecvt for that.
        *
-       *  @param c  The wchar_t to convert.
-       *  @param dfault  Char to return if conversion fails.
+       *  @param __c  The wchar_t to convert.
+       *  @param __dfault  Char to return if conversion fails.
        *  @return  The converted char.
       */
       virtual char
-      do_narrow(char_type, char __dfault) const;
+      do_narrow(char_type __c, char __dfault) const;
 
       /**
        *  @brief  Narrow wchar_t array to char array
@@ -1445,15 +1446,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  Note: this is not what you want for codepage conversions.  See
        *  codecvt for that.
        *
-       *  @param lo  Pointer to start of range.
-       *  @param hi  Pointer to end of range.
-       *  @param dfault  Char to use if conversion fails.
-       *  @param to  Pointer to the destination array.
-       *  @return  @a hi.
+       *  @param __lo  Pointer to start of range.
+       *  @param __hi  Pointer to end of range.
+       *  @param __dfault  Char to use if conversion fails.
+       *  @param __to  Pointer to the destination array.
+       *  @return  @a __hi.
       */
       virtual const char_type*
       do_narrow(const char_type* __lo, const char_type* __hi,
-               char __dfault, char* __dest) const;
+               char __dfault, char* __to) const;
 
       // For use at construction time only.
       void
@@ -1503,12 +1504,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     };
 #endif
 
-_GLIBCXX_END_NAMESPACE
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
 
 // Include host and configuration specific ctype inlines.
 #include <bits/ctype_inline.h>
 
-_GLIBCXX_BEGIN_NAMESPACE(std)
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   // 22.2.2  The numeric category.
   class __num_base
@@ -1518,16 +1522,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     // Below are the indices into _S_atoms_out.
     enum
       {
-        _S_ominus,
-        _S_oplus,
-        _S_ox,
-        _S_oX,
-        _S_odigits,
-        _S_odigits_end = _S_odigits + 16,
-        _S_oudigits = _S_odigits_end,
-        _S_oudigits_end = _S_oudigits + 16,
-        _S_oe = _S_odigits + 14,  // For scientific notation, 'e'
-        _S_oE = _S_oudigits + 14, // For scientific notation, 'E'
+       _S_ominus,
+       _S_oplus,
+       _S_ox,
+       _S_oX,
+       _S_odigits,
+       _S_odigits_end = _S_odigits + 16,
+       _S_oudigits = _S_odigits_end,
+       _S_oudigits_end = _S_oudigits + 16,
+       _S_oe = _S_odigits + 14,  // For scientific notation, 'e'
+       _S_oE = _S_oudigits + 14, // For scientific notation, 'E'
        _S_oend = _S_oudigits_end
       };
 
@@ -1587,12 +1591,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 
       bool                             _M_allocated;
 
-      __numpunct_cache(size_t __refs = 0) : facet(__refs),
-      _M_grouping(NULL), _M_grouping_size(0), _M_use_grouping(false),
-      _M_truename(NULL), _M_truename_size(0), _M_falsename(NULL),
-      _M_falsename_size(0), _M_decimal_point(_CharT()),
-      _M_thousands_sep(_CharT()), _M_allocated(false)
-      { }
+      __numpunct_cache(size_t __refs = 0)
+      : facet(__refs), _M_grouping(0), _M_grouping_size(0),
+       _M_use_grouping(false),
+       _M_truename(0), _M_truename_size(0), _M_falsename(0),
+       _M_falsename_size(0), _M_decimal_point(_CharT()),
+       _M_thousands_sep(_CharT()), _M_allocated(false)
+       { }
 
       ~__numpunct_cache();
 
@@ -1602,7 +1607,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     private:
       __numpunct_cache&
       operator=(const __numpunct_cache&);
-      
+
       explicit
       __numpunct_cache(const __numpunct_cache&);
     };
@@ -1654,10 +1659,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       /**
        *  @brief  Numpunct constructor.
        *
-       *  @param  refs  Refcount to pass to the base class.
+       *  @param  __refs  Refcount to pass to the base class.
        */
       explicit
-      numpunct(size_t __refs = 0) : facet(__refs), _M_data(NULL)
+      numpunct(size_t __refs = 0)
+      : facet(__refs), _M_data(0)
       { _M_initialize_numpunct(); }
 
       /**
@@ -1666,8 +1672,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  This is a constructor for use by the library itself to set up the
        *  predefined locale facets.
        *
-       *  @param  cache  __numpunct_cache object.
-       *  @param  refs  Refcount to pass to the base class.
+       *  @param  __cache  __numpunct_cache object.
+       *  @param  __refs  Refcount to pass to the base class.
        */
       explicit
       numpunct(__cache_type* __cache, size_t __refs = 0)
@@ -1680,12 +1686,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
        *  This is a constructor for use by the library itself to set up new
        *  locales.
        *
-       *  @param  cloc  The C locale.
-       *  @param  refs  Refcount to pass to the base class.
+       *  @param  __cloc  The C locale.
+       *  @param  __refs  Refcount to pass to the base class.
        */
       explicit
       numpunct(__c_locale __cloc, size_t __refs = 0)
-      : facet(__refs), _M_data(NULL)
+      : facet(__refs), _M_data(0)
       { _M_initialize_numpunct(__cloc); }
 
       /**
@@ -1841,7 +1847,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 
       // For use at construction time only.
       void
-      _M_initialize_numpunct(__c_locale __cloc = NULL);
+      _M_initialize_numpunct(__c_locale __cloc = 0);
     };
 
   template<typename _CharT>
@@ -1890,7 +1896,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       ~numpunct_byname() { }
     };
 
-_GLIBCXX_BEGIN_LDBL_NAMESPACE
+_GLIBCXX_BEGIN_NAMESPACE_LDBL
 
   /**
    *  @brief  Primary class template num_get.
@@ -1924,7 +1930,7 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
        *
        *  This is the constructor provided by the standard.
        *
-       *  @param refs  Passed to the base facet class.
+       *  @param __refs  Passed to the base facet class.
       */
       explicit
       num_get(size_t __refs = 0) : facet(__refs) { }
@@ -1945,11 +1951,11 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
        *  except if the value is 1, sets @a v to true, if the value is 0, sets
        *  @a v to false, and otherwise set err to ios_base::failbit.
        *
-       *  @param  in  Start of input stream.
-       *  @param  end  End of input stream.
-       *  @param  io  Source of locale and flags.
-       *  @param  err  Error flags to set.
-       *  @param  v  Value to format and insert.
+       *  @param  __in  Start of input stream.
+       *  @param  __end  End of input stream.
+       *  @param  __io  Source of locale and flags.
+       *  @param  __err  Error flags to set.
+       *  @param  __v  Value to format and insert.
        *  @return  Iterator after reading.
       */
       iter_type
@@ -1973,19 +1979,20 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
        *  specifier.  Otherwise, parses like %d for signed and %u for unsigned
        *  types.  The matching type length modifier is also used.
        *
-       *  Digit grouping is interpreted according to numpunct::grouping() and
-       *  numpunct::thousands_sep().  If the pattern of digit groups isn't
-       *  consistent, sets err to ios_base::failbit.
+       *  Digit grouping is interpreted according to
+       *  numpunct::grouping() and numpunct::thousands_sep().  If the
+       *  pattern of digit groups isn't consistent, sets err to
+       *  ios_base::failbit.
        *
        *  If parsing the string yields a valid value for @a v, @a v is set.
        *  Otherwise, sets err to ios_base::failbit and leaves @a v unaltered.
        *  Sets err to ios_base::eofbit if the stream is emptied.
        *
-       *  @param  in  Start of input stream.
-       *  @param  end  End of input stream.
-       *  @param  io  Source of locale and flags.
-       *  @param  err  Error flags to set.
-       *  @param  v  Value to format and insert.
+       *  @param  __in  Start of input stream.
+       *  @param  __end  End of input stream.
+       *  @param  __io  Source of locale and flags.
+       *  @param  __err  Error flags to set.
+       *  @param  __v  Value to format and insert.
        *  @return  Iterator after reading.
       */
       iter_type
@@ -2032,19 +2039,20 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
        *  matching type length modifier is also used.
        *
        *  The decimal point character used is numpunct::decimal_point().
-       *  Digit grouping is interpreted according to numpunct::grouping() and
-       *  numpunct::thousands_sep().  If the pattern of digit groups isn't
-       *  consistent, sets err to ios_base::failbit.
+       *  Digit grouping is interpreted according to
+       *  numpunct::grouping() and numpunct::thousands_sep().  If the
+       *  pattern of digit groups isn't consistent, sets err to
+       *  ios_base::failbit.
        *
        *  If parsing the string yields a valid value for @a v, @a v is set.
        *  Otherwise, sets err to ios_base::failbit and leaves @a v unaltered.
        *  Sets err to ios_base::eofbit if the stream is emptied.
        *
-       *  @param  in  Start of input stream.
-       *  @param  end  End of input stream.
-       *  @param  io  Source of locale and flags.
-       *  @param  err  Error flags to set.
-       *  @param  v  Value to format and insert.
+       *  @param  __in  Start of input stream.
+       *  @param  __end  End of input stream.
+       *  @param  __io  Source of locale and flags.
+       *  @param  __err  Error flags to set.
+       *  @param  __v  Value to format and insert.
        *  @return  Iterator after reading.
       */
       iter_type
@@ -2071,9 +2079,10 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
        *
        *  The input characters are parsed like the scanf %p specifier.
        *
-       *  Digit grouping is interpreted according to numpunct::grouping() and
-       *  numpunct::thousands_sep().  If the pattern of digit groups isn't
-       *  consistent, sets err to ios_base::failbit.
+       *  Digit grouping is interpreted according to
+       *  numpunct::grouping() and numpunct::thousands_sep().  If the
+       *  pattern of digit groups isn't consistent, sets err to
+       *  ios_base::failbit.
        *
        *  Note that the digit grouping effect for pointers is a bit ambiguous
        *  in the standard and shouldn't be relied on.  See DR 344.
@@ -2082,11 +2091,11 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
        *  Otherwise, sets err to ios_base::failbit and leaves @a v unaltered.
        *  Sets err to ios_base::eofbit if the stream is emptied.
        *
-       *  @param  in  Start of input stream.
-       *  @param  end  End of input stream.
-       *  @param  io  Source of locale and flags.
-       *  @param  err  Error flags to set.
-       *  @param  v  Value to format and insert.
+       *  @param  __in  Start of input stream.
+       *  @param  __end  End of input stream.
+       *  @param  __io  Source of locale and flags.
+       *  @param  __err  Error flags to set.
+       *  @param  __v  Value to format and insert.
        *  @return  Iterator after reading.
       */
       iter_type
@@ -2103,14 +2112,14 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
                       string&) const;
 
       template<typename _ValueT>
-        iter_type
-        _M_extract_int(iter_type, iter_type, ios_base&, ios_base::iostate&,
+       iter_type
+       _M_extract_int(iter_type, iter_type, ios_base&, ios_base::iostate&,
                       _ValueT&) const;
 
       template<typename _CharT2>
       typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value, int>::__type
-        _M_find(const _CharT2*, size_t __len, _CharT2 __c) const
-        {
+       _M_find(const _CharT2*, size_t __len, _CharT2 __c) const
+       {
          int __ret = -1;
          if (__len <= 10)
            {
@@ -2130,10 +2139,10 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
        }
 
       template<typename _CharT2>
-      typename __gnu_cxx::__enable_if<!__is_char<_CharT2>::__value, 
+      typename __gnu_cxx::__enable_if<!__is_char<_CharT2>::__value,
                                      int>::__type
-        _M_find(const _CharT2* __zero, size_t __len, _CharT2 __c) const
-        {
+       _M_find(const _CharT2* __zero, size_t __len, _CharT2 __c) const
+       {
          int __ret = -1;
          const char_type* __q = char_traits<_CharT2>::find(__zero, __len, __c);
          if (__q)
@@ -2153,11 +2162,11 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
        *  hook for derived classes to change the value returned.  @see get()
        *  for more details.
        *
-       *  @param  in  Start of input stream.
-       *  @param  end  End of input stream.
-       *  @param  io  Source of locale and flags.
-       *  @param  err  Error flags to set.
-       *  @param  v  Value to format and insert.
+       *  @param  __beg  Start of input stream.
+       *  @param  __end  End of input stream.
+       *  @param  __io  Source of locale and flags.
+       *  @param  __err  Error flags to set.
+       *  @param  __v  Value to format and insert.
        *  @return  Iterator after reading.
       */
       virtual iter_type
@@ -2187,7 +2196,7 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
       virtual iter_type
       do_get(iter_type __beg, iter_type __end, ios_base& __io,
             ios_base::iostate& __err, long long& __v) const
-      { return _M_extract_int(__beg, __end, __io, __err, __v); }       
+      { return _M_extract_int(__beg, __end, __io, __err, __v); }
 
       virtual iter_type
       do_get(iter_type __beg, iter_type __end, ios_base& __io,
@@ -2196,32 +2205,30 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
 #endif
 
       virtual iter_type
-      do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
-            float&) const;
+      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, float&) const;
 
       virtual iter_type
-      do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&,
             double&) const;
 
       // XXX GLIBCXX_ABI Deprecated
 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
       virtual iter_type
-      __do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+      __do_get(iter_type, iter_type, ios_base&, ios_base::iostate&,
               double&) const;
 #else
       virtual iter_type
-      do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&,
             long double&) const;
 #endif
 
       virtual iter_type
-      do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
-            void*&) const;
+      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, void*&) const;
 
       // XXX GLIBCXX_ABI Deprecated
 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
       virtual iter_type
-      do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&,
             long double&) const;
 #endif
       //@}
@@ -2262,7 +2269,7 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
        *
        *  This is the constructor provided by the standard.
        *
-       *  @param refs  Passed to the base facet class.
+       *  @param __refs  Passed to the base facet class.
       */
       explicit
       num_put(size_t __refs = 0) : facet(__refs) { }
@@ -2276,15 +2283,15 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
        *  If ios_base::boolalpha is set, writes ctype<CharT>::truename() or
        *  ctype<CharT>::falsename().  Otherwise formats @a v as an int.
        *
-       *  @param  s  Stream to write to.
-       *  @param  io  Source of locale and flags.
-       *  @param  fill  Char_type to use for filling.
-       *  @param  v  Value to format and insert.
+       *  @param  __s  Stream to write to.
+       *  @param  __io  Source of locale and flags.
+       *  @param  __fill  Char_type to use for filling.
+       *  @param  __v  Value to format and insert.
        *  @return  Iterator after writing.
       */
       iter_type
-      put(iter_type __s, ios_base& __f, char_type __fill, bool __v) const
-      { return this->do_put(__s, __f, __fill, __v); }
+      put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
 
       //@{
       /**
@@ -2307,9 +2314,9 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
        *  If ios_base::showbase is set, '0' precedes octal values (except 0)
        *  and '0[xX]' precedes hex values.
        *
-       *  Thousands separators are inserted according to numpunct::grouping()
-       *  and numpunct::thousands_sep().  The decimal point character used is
-       *  numpunct::decimal_point().
+       *  The decimal point character used is numpunct::decimal_point().
+       *  Thousands separators are inserted according to
+       *  numpunct::grouping() and numpunct::thousands_sep().
        *
        *  If io.width() is non-zero, enough @a fill characters are inserted to
        *  make the result at least that wide.  If
@@ -2318,30 +2325,30 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
        *  immediately after either a '+' or '-' or after '0x' or '0X'.
        *  Otherwise, padding occurs at the beginning.
        *
-       *  @param  s  Stream to write to.
-       *  @param  io  Source of locale and flags.
-       *  @param  fill  Char_type to use for filling.
-       *  @param  v  Value to format and insert.
+       *  @param  __s  Stream to write to.
+       *  @param  __io  Source of locale and flags.
+       *  @param  __fill  Char_type to use for filling.
+       *  @param  __v  Value to format and insert.
        *  @return  Iterator after writing.
       */
       iter_type
-      put(iter_type __s, ios_base& __f, char_type __fill, long __v) const
-      { return this->do_put(__s, __f, __fill, __v); }
+      put(iter_type __s, ios_base& __io, char_type __fill, long __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
 
       iter_type
-      put(iter_type __s, ios_base& __f, char_type __fill,
+      put(iter_type __s, ios_base& __io, char_type __fill,
          unsigned long __v) const
-      { return this->do_put(__s, __f, __fill, __v); }
+      { return this->do_put(__s, __io, __fill, __v); }
 
 #ifdef _GLIBCXX_USE_LONG_LONG
       iter_type
-      put(iter_type __s, ios_base& __f, char_type __fill, long long __v) const
-      { return this->do_put(__s, __f, __fill, __v); }
+      put(iter_type __s, ios_base& __io, char_type __fill, long long __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
 
       iter_type
-      put(iter_type __s, ios_base& __f, char_type __fill,
+      put(iter_type __s, ios_base& __io, char_type __fill,
          unsigned long long __v) const
-      { return this->do_put(__s, __f, __fill, __v); }
+      { return this->do_put(__s, __io, __fill, __v); }
 #endif
       //@}
 
@@ -2370,9 +2377,9 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
        *  If ios_base::showpoint is set, a decimal point will always be
        *  output.
        *
-       *  Thousands separators are inserted according to numpunct::grouping()
-       *  and numpunct::thousands_sep().  The decimal point character used is
-       *  numpunct::decimal_point().
+       *  The decimal point character used is numpunct::decimal_point().
+       *  Thousands separators are inserted according to
+       *  numpunct::grouping() and numpunct::thousands_sep().
        *
        *  If io.width() is non-zero, enough @a fill characters are inserted to
        *  make the result at least that wide.  If
@@ -2381,20 +2388,20 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
        *  immediately after either a '+' or '-' or after '0x' or '0X'.
        *  Otherwise, padding occurs at the beginning.
        *
-       *  @param  s  Stream to write to.
-       *  @param  io  Source of locale and flags.
-       *  @param  fill  Char_type to use for filling.
-       *  @param  v  Value to format and insert.
+       *  @param  __s  Stream to write to.
+       *  @param  __io  Source of locale and flags.
+       *  @param  __fill  Char_type to use for filling.
+       *  @param  __v  Value to format and insert.
        *  @return  Iterator after writing.
       */
       iter_type
-      put(iter_type __s, ios_base& __f, char_type __fill, double __v) const
-      { return this->do_put(__s, __f, __fill, __v); }
+      put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
 
       iter_type
-      put(iter_type __s, ios_base& __f, char_type __fill,
+      put(iter_type __s, ios_base& __io, char_type __fill,
          long double __v) const
-      { return this->do_put(__s, __f, __fill, __v); }
+      { return this->do_put(__s, __io, __fill, __v); }
       //@}
 
       /**
@@ -2406,21 +2413,21 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
        *  This function formats @a v as an unsigned long with ios_base::hex
        *  and ios_base::showbase set.
        *
-       *  @param  s  Stream to write to.
-       *  @param  io  Source of locale and flags.
-       *  @param  fill  Char_type to use for filling.
-       *  @param  v  Value to format and insert.
+       *  @param  __s  Stream to write to.
+       *  @param  __io  Source of locale and flags.
+       *  @param  __fill  Char_type to use for filling.
+       *  @param  __v  Value to format and insert.
        *  @return  Iterator after writing.
       */
       iter_type
-      put(iter_type __s, ios_base& __f, char_type __fill,
+      put(iter_type __s, ios_base& __io, char_type __fill,
          const void* __v) const
-      { return this->do_put(__s, __f, __fill, __v); }
+      { return this->do_put(__s, __io, __fill, __v); }
 
     protected:
       template<typename _ValueT>
-        iter_type
-        _M_insert_float(iter_type, ios_base& __io, char_type __fill,
+       iter_type
+       _M_insert_float(iter_type, ios_base& __io, char_type __fill,
                        char __mod, _ValueT __v) const;
 
       void
@@ -2429,8 +2436,8 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
                     char_type* __cs, int& __len) const;
 
       template<typename _ValueT>
-        iter_type
-        _M_insert_int(iter_type, ios_base& __io, char_type __fill,
+       iter_type
+       _M_insert_int(iter_type, ios_base& __io, char_type __fill,
                      _ValueT __v) const;
 
       void
@@ -2454,18 +2461,18 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
        *  inserting them into a stream. This function is a hook for derived
        *  classes to change the value returned.
        *
-       *  @param  s  Stream to write to.
-       *  @param  io  Source of locale and flags.
-       *  @param  fill  Char_type to use for filling.
-       *  @param  v  Value to format and insert.
+       *  @param  __s  Stream to write to.
+       *  @param  __io  Source of locale and flags.
+       *  @param  __fill  Char_type to use for filling.
+       *  @param  __v  Value to format and insert.
        *  @return  Iterator after writing.
       */
       virtual iter_type
-      do_put(iter_type, ios_base&, char_type __fill, bool __v) const;
+      do_put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const;
 
       virtual iter_type
       do_put(iter_type __s, ios_base& __io, char_type __fill, long __v) const
-      { return _M_insert_int(__s, __io, __fill, __v); }        
+      { return _M_insert_int(__s, __io, __fill, __v); }
 
       virtual iter_type
       do_put(iter_type __s, ios_base& __io, char_type __fill,
@@ -2485,24 +2492,24 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
 #endif
 
       virtual iter_type
-      do_put(iter_type, ios_base&, char_type __fill, double __v) const;
+      do_put(iter_type, ios_base&, char_type, double) const;
 
       // XXX GLIBCXX_ABI Deprecated
 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
       virtual iter_type
-      __do_put(iter_type, ios_base&, char_type __fill, double __v) const;
+      __do_put(iter_type, ios_base&, char_type, double) const;
 #else
       virtual iter_type
-      do_put(iter_type, ios_base&, char_type __fill, long double __v) const;
+      do_put(iter_type, ios_base&, char_type, long double) const;
 #endif
 
       virtual iter_type
-      do_put(iter_type, ios_base&, char_type __fill, const void* __v) const;
+      do_put(iter_type, ios_base&, char_type, const void*) const;
 
       // XXX GLIBCXX_ABI Deprecated
 #if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
       virtual iter_type
-      do_put(iter_type, ios_base&, char_type __fill, long double __v) const;
+      do_put(iter_type, ios_base&, char_type, long double) const;
 #endif
       //@}
     };
@@ -2510,7 +2517,7 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
   template <typename _CharT, typename _OutIter>
     locale::id num_put<_CharT, _OutIter>::id;
 
-_GLIBCXX_END_LDBL_NAMESPACE
+_GLIBCXX_END_NAMESPACE_LDBL
 
   // Subclause convenience interfaces, inlines.
   // NB: These are inline because, when used in a loop, some compilers
@@ -2543,7 +2550,7 @@ _GLIBCXX_END_LDBL_NAMESPACE
 
   /// Convenience interface to ctype.is(ctype_base::lower, __c).
   template<typename _CharT>
-    inline bool 
+    inline bool
     islower(_CharT __c, const locale& __loc)
     { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::lower, __c); }
 
@@ -2595,10 +2602,9 @@ _GLIBCXX_END_LDBL_NAMESPACE
     tolower(_CharT __c, const locale& __loc)
     { return use_facet<ctype<_CharT> >(__loc).tolower(__c); }
 
-_GLIBCXX_END_NAMESPACE
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
 
-#ifndef _GLIBCXX_EXPORT_TEMPLATE
 # include <bits/locale_facets.tcc>
-#endif
 
 #endif