Subject: [Boost-bugs] [Boost C++ Libraries] #9714: Signals2 test failure with C++11 misuse of boost::optional
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-02-26 05:10:40
#9714: Signals2 test failure with C++11 misuse of boost::optional
------------------------------+----------------------
Reporter: benpope81@⦠| Owner: fmhess
Type: Bugs | Status: new
Milestone: To Be Determined | Component: signals2
Version: Boost 1.55.0 | Severity: Problem
Keywords: |
------------------------------+----------------------
"clang++-3.4" -c -x c++ -std=c++11 -stdlib=libc++ -O0 -g -fno-inline
-Wall -g -DBOOST_ALL_NO_LIB=1 -DBOOST_TEST_NO_AUTO_LINK=1 -I".." -o
"/home/ben/development/boost/test/build/results/boost/bin.v2/libs/signals2/test/signal_test.test
/clang-linux-3.4~c11_libc++/debug/link-static/signal_test.o"
"../libs/signals2/test/signal_test.cpp"
.../libs/signals2/test/signal_test.cpp:32:16: error: invalid operands to
binary expression ('boost::optional<int>' and 'int')
if(max == false) max = *first;
~~~ ^ ~~~~~
"clang++-3.4" -c -x c++ -std=c++11 -stdlib=libc++ -O0 -g -fno-inline
-Wall -g -DBOOST_ALL_NO_LIB=1 -DBOOST_TEST_NO_AUTO_LINK=1 -I".." -o
"/home/ben/development/boost/test/build/results/boost/bin.v2/libs/signals2/test/track_test.test
/clang-linux-3.4~c11_libc++/debug/link-static/track_test.o"
"../libs/signals2/test/track_test.cpp"
.../libs/signals2/test/track_test.cpp:36:14: error: invalid operands to
binary expression ('boost::optional<int>' and 'int')
if(max == false)
Essentially false is not treated as a null pointer constant in C++11.
The trivial fix is to change the if statements at:
.../libs/signals2/test/signal_test.cpp:32:16:
.../libs/signals2/test/track_test.cpp:36:14:
to:
if(!max) rather than if(max == false)
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9714> 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:15 UTC