Neil Conway created MESOS-6539:
----------------------------------

             Summary: Compile warning in GMock: "binding dereferenced null 
pointer to reference"
                 Key: MESOS-6539
                 URL: https://issues.apache.org/jira/browse/MESOS-6539
             Project: Mesos
          Issue Type: Bug
          Components: technical debt
            Reporter: Neil Conway


{noformat}
In file included from ../gmock-1.7.0/include/gmock/gmock-actions.h:46:
../gmock-1.7.0/include/gmock/internal/gmock-internal-utils.h:371:7: warning: 
binding dereferenced null pointer to reference has undefined behavior 
[-Wnull-dereference]
      *static_cast<volatile typename remove_reference<T>::type*>(NULL));
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../gmock-1.7.0/include/gmock/gmock-actions.h:78:22: note: in instantiation of 
function template specialization 
'testing::internal::Invalid<process::Future<bool> >' requested here
    return internal::Invalid<T>();
                     ^
../gmock-1.7.0/include/gmock/gmock-actions.h:190:43: note: in instantiation of 
member function 'testing::internal::BuiltInDefaultValue<process::Future<bool> 
>::Get' requested here
        internal::BuiltInDefaultValue<T>::Get() : *value_;
                                          ^
../gmock-1.7.0/include/gmock/gmock-spec-builders.h:1460:34: note: in 
instantiation of member function 'testing::DefaultValue<process::Future<bool> 
>::Get' requested here
    return DefaultValue<Result>::Get();
                                 ^
../gmock-1.7.0/include/gmock/gmock-spec-builders.h:1350:22: note: in 
instantiation of member function 
'testing::internal::FunctionMockerBase<process::Future<bool> 
(bool)>::PerformDefaultAction' requested here
        func_mocker->PerformDefaultAction(args, call_description));
                     ^
../gmock-1.7.0/include/gmock/gmock-spec-builders.h:1473:26: note: in 
instantiation of function template specialization 
'testing::internal::ActionResultHolder<process::Future<bool> 
>::PerformDefaultAction<process::Future<bool> (bool)>' requested here
    return ResultHolder::PerformDefaultAction(this, args, call_description);
                         ^
../../../mesos/3rdparty/libprocess/src/tests/process_tests.cpp:152:7: note: in 
instantiation of member function 
'testing::internal::FunctionMockerBase<process::Future<bool> 
(bool)>::UntypedPerformDefaultAction' requested here
class DispatchProcess : public Process<DispatchProcess>
      ^
In file included from 
../../../mesos/3rdparty/libprocess/src/tests/process_tests.cpp:20:
{noformat}

The code in question has changed in upstream GMock: 
https://github.com/google/googletest/blob/master/googlemock/include/gmock/internal/gmock-internal-utils.h#L377

So the easiest fix is probably to vendor GMock 1.8.0



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to