X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=libstdc%2B%2B-v3%2Fsrc%2Fc%2B%2B11%2Fcow-locale_init.cc;h=4d5c08f20cc62cf2bc4228ca1fdc719159dbbc0d;hb=7adcbafe45f8001b698967defe682687b52c0007;hp=0856e35b916a831b29a4456c5cadcd2cb72dc630;hpb=818ab71a415cd234be092111a0aa5e812ec56434;p=thirdparty%2Fgcc.git diff --git a/libstdc++-v3/src/c++11/cow-locale_init.cc b/libstdc++-v3/src/c++11/cow-locale_init.cc index 0856e35b916a..4d5c08f20cc6 100644 --- a/libstdc++-v3/src/c++11/cow-locale_init.cc +++ b/libstdc++-v3/src/c++11/cow-locale_init.cc @@ -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)] __attribute__ ((aligned(__alignof__(std::collate)))); @@ -50,7 +50,7 @@ namespace typedef char fake_money_get_c[sizeof(money_get)] __attribute__ ((aligned(__alignof__(money_get)))); fake_money_get_c money_get_c; - + typedef char fake_money_put_c[sizeof(money_put)] __attribute__ ((aligned(__alignof__(money_put)))); fake_money_put_c money_put_c; @@ -80,7 +80,7 @@ namespace typedef char fake_money_get_w[sizeof(money_get)] __attribute__ ((aligned(__alignof__(money_get)))); fake_money_get_w money_get_w; - + typedef char fake_money_put_w[sizeof(money_put)] __attribute__ ((aligned(__alignof__(money_put)))); fake_money_put_w money_put_w; @@ -125,6 +125,7 @@ namespace _M_init_facet_unchecked(new (&messages_w) std::messages(1)); #endif + // The caches must be populated last, after creating all facets. _M_caches[numpunct::id._M_id()] = __npc; _M_caches[moneypunct::id._M_id()] = __mpcf; _M_caches[moneypunct::id._M_id()] = __mpct; @@ -161,7 +162,7 @@ namespace _M_init_facet_unchecked(new money_put); _M_init_facet_unchecked(new time_get); _M_init_facet_unchecked(new std::messages(__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 += ';';