summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/bits
diff options
context:
space:
mode:
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-23 11:30:32 +0000
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-23 11:30:32 +0000
commitd5498faa9520dcfe7fc17011625f3fb36d89bdf3 (patch)
treef6d875ca56fa30af1dfb0d9afa2c9fa4b9cab7f5 /libstdc++-v3/include/bits
parent8412c05c0475b89aba443947ad23db6e8934fdbd (diff)
downloadgcc-d5498faa9520dcfe7fc17011625f3fb36d89bdf3.tar.gz
* include/bits/parse_numbers.h (_Number_help): Fix divide-by-zero.
* include/std/chrono (_Checked_integral_constant): Allow zero. * testsuite/20_util/duration/literals/values.cc: Test non-positive values and digit separators. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211890 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/bits')
-rw-r--r--libstdc++-v3/include/bits/parse_numbers.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/libstdc++-v3/include/bits/parse_numbers.h b/libstdc++-v3/include/bits/parse_numbers.h
index a29d1272255..f46c59c44da 100644
--- a/libstdc++-v3/include/bits/parse_numbers.h
+++ b/libstdc++-v3/include/bits/parse_numbers.h
@@ -190,10 +190,11 @@ namespace __parse_int
using __digit = _Digit<_Base, _Dig>;
using __valid_digit = typename __digit::__valid;
using __next = _Number_help<_Base,
- _Pow / (_Base * __valid_digit::value),
+ __valid_digit::value ? _Pow / _Base : _Pow,
_Digs...>;
using type = __ull_constant<_Pow * __digit::value + __next::type::value>;
- static_assert((type::value / _Pow) == __digit::value, "overflow");
+ static_assert((type::value / _Pow) == __digit::value,
+ "integer literal does not fit in unsigned long long");
};
template<unsigned _Base, unsigned long long _Pow, char _Dig>
@@ -214,7 +215,6 @@ namespace __parse_int
{ };
//------------------------------------------------------------------------------
-// This _Parse_int is the same 'level' as the old _Base_dispatch.
template<char... _Digs>
struct _Parse_int;