diff options
author | Jeffrey Yasskin <jyasskin@gcc.gnu.org> | 2012-02-05 12:58:51 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2012-02-05 12:58:51 +0000 |
commit | cee8c7a27442ef2733b603af6497e832da28be30 (patch) | |
tree | f4da6d6cd4e6a2187bc2b2a1b9659e75a82df0ae /libstdc++-v3 | |
parent | b1c02fdc550e83ba4dbb907cce1808fac2f0ecef (diff) | |
download | gcc-cee8c7a27442ef2733b603af6497e832da28be30.zip gcc-cee8c7a27442ef2733b603af6497e832da28be30.tar.gz gcc-cee8c7a27442ef2733b603af6497e832da28be30.tar.bz2 |
re PR c++/52119 ([C++11] overflow in signed left shift isn't diagnosed)
2012-02-05 Jeffrey Yasskin <jyasskin@gcc.gnu.org>
Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/52119
* include/std/limits (__glibcxx_min): Fix to avoid undefined behavior.
From-SVN: r183905
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 8 | ||||
-rw-r--r-- | libstdc++-v3/include/std/limits | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 187ee49..96125f9 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2012-02-05 Jeffrey Yasskin <jyasskin@gcc.gnu.org> + Paolo Carlini <paolo.carlini@oracle.com> + + PR libstdc++/52119 + * include/std/limits (__glibcxx_min): Fix to avoid undefined behavior. + 2012-02-03 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/49445 @@ -97,7 +103,7 @@ PR libstdc++/51795 * include/bits/random.h (linear_congruential_generator): Add static_assert preventing instantiation for values of 'a' and 'm' - currently handled incorrectly but _Mod::__calc. + currently handled incorrectly by _Mod::__calc. * include/bits/random.tcc (seed_seq::generate): Avoid unsafe uses of _Mod::__calc. diff --git a/libstdc++-v3/include/std/limits b/libstdc++-v3/include/std/limits index 67a5af4..ea37d9d 100644 --- a/libstdc++-v3/include/std/limits +++ b/libstdc++-v3/include/std/limits @@ -1,7 +1,7 @@ // The template and inlines for the numeric_limits classes. -*- C++ -*- // Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, -// 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +// 2008, 2009, 2010, 2011, 2012 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 @@ -129,7 +129,7 @@ #define __glibcxx_signed(T) ((T)(-1) < 0) #define __glibcxx_min(T) \ - (__glibcxx_signed (T) ? (T)1 << __glibcxx_digits (T) : (T)0) + (__glibcxx_signed (T) ? -__glibcxx_max (T) - 1 : (T)0) #define __glibcxx_max(T) \ (__glibcxx_signed (T) ? \ |