[type_traits] small workaround logic change

Hello, I suggest that the following patch be applied to type_traits/detail/cv_traits_impl.hpp: --- cv_traits_impl.hpp 22 Jun 2005 16:59:26 -0000 1.4 +++ cv_traits_impl.hpp 14 Jul 2005 06:49:40 -0000 @@ -19,7 +19,7 @@ // implementation helper: -#if !(BOOST_WORKAROUND(__GNUC__,== 3) && (__GNUC_MINOR__ <= 2)) +#if !(BOOST_WORKAROUND(__GNUC__,== 3) && BOOST_WORKAROUND(__GNUC_MINOR__, <= 2)) namespace boost { namespace detail { #else The reason is that later in the file, we have: #if BOOST_WORKAROUND(__GNUC__,== 3) && BOOST_WORKAROUND(__GNUC_MINOR__, <= 2) and first condition does not exactly match the second condition. Specifically, suppose __GNUC__ is set to 3 and __GNUC_MINOR__ is not set. The first condition will evaluate to ! (BOOST_WORKAROUND(__GNUC__, == 3) && (__GNUC_MINOR__ <= 2) = ! (1 && (0 <= 2)) = ! (1 && 1 ) = 0 The second condition in the file will evaluate to: BOOST_WORKAROUND(__GNUC__,== 3) && BOOST_WORKAROUND(__GNUC_MINOR__, <= 2) = 1 && 0 = 0 So, both conditions evaluate to the same value, while they are supposed to be mutually exclusive. The case where __GNUC_MINOR__ is not set is a pathological -- I've found it when playing with some C++ parser, but the patch should do no harm. Opinions? - Volodya

On Jul 14, 2005, at 1:57 AM, Vladimir Prus wrote:
Hello, I suggest that the following patch be applied to type_traits/detail/cv_traits_impl.hpp: [snip] Specifically, suppose __GNUC__ is set to 3 and __GNUC_MINOR__ is not set. The first condition will evaluate to [snip] Opinions?
Please do not commit this change until after the release. Only changes that fix bugs (this will never show up as a bug) should go in this close to a release. Doug
participants (3)
-
Douglas Gregor
-
John Maddock
-
Vladimir Prus