]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/src/c++11/cow-locale_init.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / src / c++11 / cow-locale_init.cc
index 0856e35b916a831b29a4456c5cadcd2cb72dc630..4d5c08f20cc62cf2bc4228ca1fdc719159dbbc0d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2016 Free Software Foundation, Inc.
+// Copyright (C) 2014-2022 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
@@ -32,7 +32,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
-namespace 
+namespace
 {
   typedef char fake_collate_c[sizeof(std::collate<char>)]
   __attribute__ ((aligned(__alignof__(std::collate<char>))));
@@ -50,7 +50,7 @@ namespace
   typedef char fake_money_get_c[sizeof(money_get<char>)]
   __attribute__ ((aligned(__alignof__(money_get<char>))));
   fake_money_get_c money_get_c;
-  
+
   typedef char fake_money_put_c[sizeof(money_put<char>)]
   __attribute__ ((aligned(__alignof__(money_put<char>))));
   fake_money_put_c money_put_c;
@@ -80,7 +80,7 @@ namespace
   typedef char fake_money_get_w[sizeof(money_get<wchar_t>)]
   __attribute__ ((aligned(__alignof__(money_get<wchar_t>))));
   fake_money_get_w money_get_w;
-  
+
   typedef char fake_money_put_w[sizeof(money_put<wchar_t>)]
   __attribute__ ((aligned(__alignof__(money_put<wchar_t>))));
   fake_money_put_w money_put_w;
@@ -125,6 +125,7 @@ namespace
     _M_init_facet_unchecked(new (&messages_w) std::messages<wchar_t>(1));
 #endif
 
+    // The caches must be populated last, after creating all facets.
     _M_caches[numpunct<char>::id._M_id()] = __npc;
     _M_caches[moneypunct<char, false>::id._M_id()] = __mpcf;
     _M_caches[moneypunct<char, true>::id._M_id()] = __mpct;
@@ -161,7 +162,7 @@ namespace
     _M_init_facet_unchecked(new money_put<wchar_t>);
     _M_init_facet_unchecked(new time_get<wchar_t>);
     _M_init_facet_unchecked(new std::messages<wchar_t>(__cloc, __s));
-#endif   
+#endif
   }
 
 // TODO should be in another file
@@ -178,7 +179,7 @@ namespace
        __ret.reserve(128);
        __ret += _S_categories[0];
        __ret += '=';
-       __ret += _M_impl->_M_names[0]; 
+       __ret += _M_impl->_M_names[0];
        for (size_t __i = 1; __i < _S_categories_size; ++__i)
          {
            __ret += ';';