jimporter / mettle

A C++20 unit test framework
https://jimporter.github.io/mettle
BSD 3-Clause "New" or "Revised" License
122 stars 12 forks source link

Build fixed since boost v1.58 #25

Closed luav closed 6 years ago

luav commented 6 years ago

The was a mettle build error with boost v1.58 (default on Ubuntu 16.04 LTS):

/opt/repos/mettle/src/mettle/posix/../log_pipe.hpp:21:67:   required from here
/usr/include/boost/variant/get.hpp:212:5: error: static assertion failed: boost::variant does not contain specified type U, call to boost::get<U>(boost::variant<T...>&) will always throw boost::bad_get exception

The cause is that boost::get() resolves to boost::strict_get() instead of the former boost::relaxed_get() since v 1.58, see details: https://github.com/3Hren/blackhole/issues/64

jimporter commented 6 years ago

Thanks for catching this! However, this was actually revealing a bug in my code, which I've fixed in ecf7e8089d6b42616f0684d45c796a6c9c8e2b35. Now things should actually be correct, rather than almost correct. :)

luav commented 6 years ago

You are welcome @jimporter. Yes, the clean code is preferable, but you have not fully fixed the issue in the sources:

/opt/repos/mettle/src/mettle/posix/../log_pipe.hpp:50:68:   required from here
/usr/include/boost/variant/get.hpp:212:5: error: static assertion failed: boost::variant does not contain specified type U, call to boost::get<U>(boost::variant<T...>&) will always throw boost::bad_get exception
     BOOST_STATIC_ASSERT_MSG(
     ^
[11/14] c++ -x c++ -pthread '-std=c++1...d_line.o.d -o src/libmettle/cmd_line.o
ninja: build stopped: subcommand failed.
$ git log -1
commit ecf7e8089d6b42616f0684d45c796a6c9c8e2b35
Author: Jim Porter <jporter@mozilla.com>
Date:   Fri Feb 16 00:00:16 2018 -0600

    Fix usage of variant on Boost 1.58+