[Boost-bugs] [Boost C++ Libraries] #11624: BOOST_TEST( 0.0 == 0.0 ) fails under C++11 (GCC and Clang)

Subject: [Boost-bugs] [Boost C++ Libraries] #11624: BOOST_TEST( 0.0 == 0.0 ) fails under C++11 (GCC and Clang)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-09-07 10:23:58


#11624: BOOST_TEST( 0.0 == 0.0 ) fails under C++11 (GCC and Clang)
-----------------------------------------+---------------------
 Reporter: Tony Lewis <tonyelewis@…> | Owner: rogeeff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: test
  Version: Boost 1.59.0 | Severity: Problem
 Keywords: BOOST_TEST,zero,C++11,float |
-----------------------------------------+---------------------
 Thanks again for the new BOOST_TEST() tool, which looks very useful.

 Unfortunately, I'm seeing strange behaviour from the following code under
 `g++ -std=c++11` or `clang++ -std=c++11 -stdlib=libc++` :

 {{{#!cpp
 #define BOOST_TEST_MODULE zero_mod

 #include <boost/test/included/unit_test.hpp>

 BOOST_AUTO_TEST_CASE( zero ) {
         BOOST_TEST( 0.0 == 0.0 );
 }
 }}}

 If I compile with `-std=c++11`, then the test fails:

 {{{
 error: in "zero": check 0.0 == 0.0 has failed [0 != 0]. Absolute value
 exceeds tolerance [|0| > 0]
 }}}

 ...but I compile without any `-std=[...]` option, then the test passes.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11624>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC