Skip to content

Commit

Permalink
Fix compile break for Microsoft Visual Studio 2017 v141
Browse files Browse the repository at this point in the history
This is a workaround, for those who have to compile with v141 build tools,
for a bug in msvc that the compiler can't compile the WithArgsAction.

see the following link for more details:
https://developercommunityapi.westus.cloudapp.azure.com/content/problem/420339/googlemocks-withargs-doesnt-compile-with-permissiv.html
  • Loading branch information
ChristophStrehle committed Nov 21, 2019
1 parent c27aceb commit 6a9d6d5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion googlemock/include/gmock/gmock-actions.h
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,8 @@ struct WithArgsAction {
// We use the conversion operator to detect the signature of the inner Action.
template <typename R, typename... Args>
operator Action<R(Args...)>() const { // NOLINT
Action<R(typename std::tuple_element<I, std::tuple<Args...>>::type...)>
using TupleType = std::tuple<Args...>;
Action<R(typename std::tuple_element<I, TupleType>::type...)>
converted(action);

return [converted](Args... args) -> R {
Expand Down

0 comments on commit 6a9d6d5

Please sign in to comment.