regex_compiler.h (_S_cache_size): Multiply the RHS of the shift-expression by _UseCac...
authorMarek Polacek <polacek@redhat.com>
Wed, 3 Dec 2014 16:16:33 +0000 (16:16 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 3 Dec 2014 16:16:33 +0000 (16:16 +0000)
* include/bits/regex_compiler.h (_S_cache_size): Multiply the
RHS of the shift-expression by _UseCache::value.

From-SVN: r218322

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/regex_compiler.h

index 9a519138f91f6af69d5dae3c371f630456ea1f15..a3de7b096aee96431e8fe58c24ac1caf3ce5135b 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-03  Marek Polacek  <polacek@redhat.com>
+
+       * include/bits/regex_compiler.h (_S_cache_size): Multiply the
+       RHS of the shift-expression by _UseCache::value.
+
 2014-12-03  Jonathan Wakely  <jwakely@redhat.com>
 
        PR libstdc++/64168
index d8880cc4794fab62df917fabdf8de07d746c07a2..66a4483ff7b5dd723cff576ac5c63b298a3c9a09 100644 (file)
@@ -417,7 +417,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       typedef typename std::is_same<_CharT, char>::type _UseCache;
 
       static constexpr size_t
-      _S_cache_size() { return 1ul << (sizeof(_CharT) * __CHAR_BIT__); }
+      _S_cache_size()
+      {
+       return 1ul << (sizeof(_CharT) * __CHAR_BIT__ * int(_UseCache::value));
+      }
 
       struct _Dummy { };
       typedef typename std::conditional<_UseCache::value,