Skip to content

Commit

Permalink
Workaround an issue with "delete this" in GMock and gcc 6.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed May 15, 2016
1 parent cc9b051 commit d00b43c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/gmock/gmock.h
Original file line number Diff line number Diff line change
Expand Up @@ -10090,8 +10090,9 @@ class FunctionMockerBase : public UntypedFunctionMockerBase {
// threads concurrently.
Result InvokeWith(const ArgumentTuple& args)
GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
return static_cast<const ResultHolder*>(
this->UntypedInvokeWith(&args))->GetValueAndDelete();
const ResultHolder *rh = static_cast<const ResultHolder*>(
this->UntypedInvokeWith(&args));
return rh ? rh->GetValueAndDelete() : Result();
}

// Adds and returns a default action spec for this mock function.
Expand Down

0 comments on commit d00b43c

Please sign in to comment.