Boost logo

Boost :

Subject: Re: [boost] [review] outcome broken on clang with libstdc++ (Linux) and Apple clang with libc++
From: Glen Fernandes (glen.fernandes_at_[hidden])
Date: 2018-01-27 21:55:45


On Sat, Jan 27, 2018 at 3:07 PM, Niall Douglas wrote:
> b2 libs/afio/test works fine with VS2017. So it would seem that that ICE
> Vinnie encountered is some weird corner case nobody could have
> anticipated. As I mentioned, almost all of the development of Outcome
> was done on MSVC. It's very well tested on MSVC, and I've never seen
> anything like that ICE before.

I just tried boost-outcome unit tests with clang 4.0, 5.0 on Linux
with libstdc++ with -std=c++14 and -std=c++1z which fails with many
errors:

e.g.
In file included from libs/outcome/test/tests/comparison.cpp:35:
In file included from
libs/outcome/test/tests/../../include/boost/outcome/outcome.hpp:34:
In file included from
libs/outcome/test/tests/../../include/boost/outcome/detail/outcome_exception_observers.hpp:34:
In file included from
libs/outcome/test/tests/../../include/boost/outcome/detail/result_storage.hpp:34:
libs/outcome/test/tests/../../include/boost/outcome/detail/../success_failure.hpp:54:42:
error: no template named 'conditional_t' in namespace 'std'; did you
mean 'conditional'?
template <class T> using devoid =
std::conditional_t<std::is_void<T>::value, void_type, T>;
~~~~~^~~~~~~~~~~~~
conditional
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/type_traits:1780:12:
note: 'conditional' declared here
struct conditional
^

Then I also tried the boost-outcome unit tests with Apple clang 8.1.0
with libc++ with -std=c++14 and -std=c++1z which fails with errors
like:

clang-darwin.compile.c++
bin.v2/libs/outcome/test/outcome-int-int-1.test/clang-darwin-4.2.1/debug/cxxstd-14-iso/outcome-int-int-1.o
libs/outcome/test/compile-fail/outcome-int-int-1.cpp:12:26: error: no
matching constructor for initialization of 'outcome<int, int, int>'
outcome<int, int, int> m(5);
^ ~
libs/outcome/test/compile-fail/../../include/boost/outcome/outcome.hpp:222:31:
note: candidate constructor (the implicit copy constructor) not
viable: no known conversion from 'int' to 'const
boost::outcome_v2::outcome<int, int, int,
boost::outcome_v2::policy::all_narrow>' for 1st argument
class BOOST_OUTCOME_NODISCARD outcome
^

Is this also a known issue? Only gcc 6 and gcc 7 with lisbtdc++ on
Linux seem to pass. The other combinations I tried (clang + lisbtdc++
on Linux, Apple clang + libc++) do not.

Glen


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk