From: Jonathan Wakely Date: Fri, 22 Jun 2018 13:05:20 +0000 (+0100) Subject: PR libstdc++/86280 fix undefined left shift on 32-bit targets X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0b4bc9a1e806d25bb9c290368f2650d4e6bb8d1c;p=gcc.git PR libstdc++/86280 fix undefined left shift on 32-bit targets PR libstdc++/86280 * include/experimental/memory_resource (__resource_adaptor_common::_AlignMgr::_M_token_size): Use type large enough for result of left shift. From-SVN: r261888 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 1c4e467bbbe..cf644b45b17 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,10 @@ 2018-06-22 Jonathan Wakely + PR libstdc++/86280 + * include/experimental/memory_resource + (__resource_adaptor_common::_AlignMgr::_M_token_size): Use type large + enough for result of left shift. + PR libstdc++/86138 * include/bits/basic_string.tcc: [__cplusplus > 201402 && !_GLIBCXX_USE_CXX11_ABI] diff --git a/libstdc++-v3/include/experimental/memory_resource b/libstdc++-v3/include/experimental/memory_resource index 8f5a8df14c9..1965fdcfe73 100644 --- a/libstdc++-v3/include/experimental/memory_resource +++ b/libstdc++-v3/include/experimental/memory_resource @@ -326,7 +326,7 @@ namespace pmr { return 1; if (_M_align <= (1ul << (sizeof(short) * __CHAR_BIT__))) return sizeof(short); - if (_M_align <= (1ul << (sizeof(int) * __CHAR_BIT__))) + if (_M_align <= (1ull << (sizeof(int) * __CHAR_BIT__))) return sizeof(int); return sizeof(char*); }