Benno Evers created MESOS-9328:
----------------------------------

             Summary: Mock slave in mesos tests does not compile using gcc 8
                 Key: MESOS-9328
                 URL: https://issues.apache.org/jira/browse/MESOS-9328
             Project: Mesos
          Issue Type: Bug
            Reporter: Benno Evers


Attempting to compile the mesos tests on a Fedora 28 machine using gcc 8 
results in the following error:

{noformat}
../../3rdparty/libprocess/include/process/future.hpp: In instantiation of 
‘process::Future<T>::Future(const U&) [with U = const 
testing::MatcherInterface<const std::tuple<const process::Future<Nothing>&>&>*; 
T = Nothing]’:
/usr/include/c++/8/type_traits:920:12:   required from ‘struct 
std::is_constructible<const process::Future<Nothing>&, const 
testing::MatcherInterface<const std::tuple<const 
process::Future<Nothing>&>&>*&>’
/usr/include/c++/8/type_traits:126:12:   required from ‘struct 
std::__and_<std::is_constructible<const process::Future<Nothing>&, const 
testing::MatcherInterface<const std::tuple<const 
process::Future<Nothing>&>&>*&> >’
/usr/include/c++/8/tuple:485:68:   required from ‘static constexpr bool 
std::_TC<<anonymous>, _Elements>::_MoveConstructibleTuple() [with _UElements = 
{const testing::MatcherInterface<const std::tuple<const 
process::Future<Nothing>&>&>*&}; bool <anonymous> = true; _Elements = {const 
process::Future<Nothing>&}]’
/usr/include/c++/8/tuple:641:59:   required by substitution of ‘template<class 
... _UElements, typename std::enable_if<((std::_TC<((1 == sizeof... 
(_UElements)) && std::_TC<(sizeof... (_UElements) == 1), const 
process::Future<Nothing>&>::_NotSameTuple<_UElements ...>()), const 
process::Future<Nothing>&>::_MoveConstructibleTuple<_UElements ...>() && 
std::_TC<((1 == sizeof... (_UElements)) && std::_TC<(sizeof... (_UElements) == 
1), const process::Future<Nothing>&>::_NotSameTuple<_UElements ...>()), const 
process::Future<Nothing>&>::_ImplicitlyMoveConvertibleTuple<_UElements ...>()) 
&& (1 >= 1)), bool>::type <anonymous> > constexpr std::tuple<const 
process::Future<Nothing>&>::tuple(_UElements&& ...) [with _UElements = {const 
testing::MatcherInterface<const std::tuple<const 
process::Future<Nothing>&>&>*&}; typename std::enable_if<((std::_TC<((1 == 
sizeof... (_UElements)) && std::_TC<(sizeof... (_UElements) == 1), const 
process::Future<Nothing>&>::_NotSameTuple<_UElements ...>()), const 
process::Future<Nothing>&>::_MoveConstructibleTuple<_UElements ...>() && 
std::_TC<((1 == sizeof... (_UElements)) && std::_TC<(sizeof... (_UElements) == 
1), const process::Future<Nothing>&>::_NotSameTuple<_UElements ...>()), const 
process::Future<Nothing>&>::_ImplicitlyMoveConvertibleTuple<_UElements ...>()) 
&& (1 >= 1)), bool>::type <anonymous> = 1]’
../3rdparty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:485:10:
   required from ‘testing::Matcher<A1> testing::MakeMatcher(const 
testing::MatcherInterface<T>*) [with T = const std::tuple<const 
process::Future<Nothing>&>&]’
../3rdparty/googletest-release-1.8.0/googlemock/include/gmock/gmock-matchers.h:3732:43:
   required from ‘testing::Matcher<A1> testing::A() [with T = const 
std::tuple<const process::Future<Nothing>&>&]’
../3rdparty/googletest-release-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:893:47:
   required from 
‘testing::internal::TypedExpectation<F>::TypedExpectation(testing::internal::FunctionMockerBase<F>*,
 const char*, int, const string&, const ArgumentMatcherTuple&) [with F = 
void(const process::Future<Nothing>&); testing::internal::string = 
std::__cxx11::basic_string<char>; 
testing::internal::TypedExpectation<F>::ArgumentMatcherTuple = 
std::tuple<testing::Matcher<const process::Future<Nothing>&> >]’
../3rdparty/googletest-release-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1609:9:
   required from ‘testing::internal::TypedExpectation<F>& 
testing::internal::FunctionMockerBase<F>::AddNewExpectation(const char*, int, 
const string&, const ArgumentMatcherTuple&) [with F = void(const 
process::Future<Nothing>&); testing::internal::string = 
std::__cxx11::basic_string<char>; 
testing::internal::FunctionMockerBase<F>::ArgumentMatcherTuple = 
std::tuple<testing::Matcher<const process::Future<Nothing>&> >]’
../3rdparty/googletest-release-1.8.0/googlemock/include/gmock/gmock-spec-builders.h:1273:43:
   required from ‘testing::internal::TypedExpectation<F>& 
testing::internal::MockSpec<F>::InternalExpectedAt(const char*, int, const 
char*, const char*) [with F = void(const process::Future<Nothing>&)]’
../../src/tests/mock_slave.cpp:141:3:   required from here
../../3rdparty/libprocess/include/process/future.hpp:1092:3: error: no matching 
function for call to ‘process::Future<Nothing>::set(const 
testing::MatcherInterface<const std::tuple<const process::Future<Nothing>&>&>* 
const&)’
   set(u);
   ^~~
../../3rdparty/libprocess/include/process/future.hpp:1761:6: note: candidate: 
‘bool process::Future<T>::set(const T&) [with T = Nothing]’
 bool Future<T>::set(const T& t)
      ^~~~~~~~~
../../3rdparty/libprocess/include/process/future.hpp:1761:6: note:   no known 
conversion for argument 1 from ‘const testing::MatcherInterface<const 
std::tuple<const process::Future<Nothing>&>&>* const’ to ‘const Nothing&’
../../3rdparty/libprocess/include/process/future.hpp:1754:6: note: candidate: 
‘bool process::Future<T>::set(T&&) [with T = Nothing]’
 bool Future<T>::set(T&& t)
      ^~~~~~~~~
../../3rdparty/libprocess/include/process/future.hpp:1754:6: note:   no known 
conversion for argument 1 from ‘const testing::MatcherInterface<const 
std::tuple<const process::Future<Nothing>&>&>* const’ to ‘Nothing&&’
make[1]: *** [Makefile:10735: tests/mesos_tests-mock_slave.o] Error 1
{noformat}

The offending line looks like this:
{noformat}
  // mock_slave.cpp:141
  EXPECT_CALL(*this, __recover(_))
    .WillRepeatedly(Invoke(this, &MockSlave::unmocked___recover));
{noformat}

>From a first glance, it looks like it is caused by additional compile-time 
>checks on a tuple automatically constructed by gmock, but some deeper 
>investigatin is necessary to identify the root cause.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to