From e30305d13c6d6ae6a653e92dbb10bedecdafb017 Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Fri, 19 Aug 2011 15:40:42 +0000 Subject: [PATCH] ratio: fix #5724: 0 + 0 and 0 - 0 lead to a compile time error [SVN r73918] --- test/ratio_arithmetic/ratio_add_pass.cpp | 6 ++++++ test/ratio_arithmetic/ratio_subtract_pass.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/test/ratio_arithmetic/ratio_add_pass.cpp b/test/ratio_arithmetic/ratio_add_pass.cpp index 9a9a20f..cdade4b 100644 --- a/test/ratio_arithmetic/ratio_add_pass.cpp +++ b/test/ratio_arithmetic/ratio_add_pass.cpp @@ -20,6 +20,12 @@ void test() { + { + typedef boost::ratio<0> R1; + typedef boost::ratio<0> R2; + typedef boost::ratio_add R; + BOOST_RATIO_STATIC_ASSERT(R::num == 0 && R::den == 1, NOTHING, ()); + } { typedef boost::ratio<1, 1> R1; typedef boost::ratio<1, 1> R2; diff --git a/test/ratio_arithmetic/ratio_subtract_pass.cpp b/test/ratio_arithmetic/ratio_subtract_pass.cpp index 32ecb78..4c5334a 100644 --- a/test/ratio_arithmetic/ratio_subtract_pass.cpp +++ b/test/ratio_arithmetic/ratio_subtract_pass.cpp @@ -21,6 +21,12 @@ void test() { + { + typedef boost::ratio<0> R1; + typedef boost::ratio<0> R2; + typedef boost::ratio_subtract R; + BOOST_RATIO_STATIC_ASSERT(R::num == 0 && R::den == 1, NOTHING, ()); + } { typedef boost::ratio<1, 1> R1; typedef boost::ratio<1, 1> R2;