aboutsummaryrefslogtreecommitdiffstats
path: root/include/gmock/gmock-more-actions.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/gmock/gmock-more-actions.h')
-rw-r--r--include/gmock/gmock-more-actions.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/gmock/gmock-more-actions.h b/include/gmock/gmock-more-actions.h
index c754440e..3d387b6b 100644
--- a/include/gmock/gmock-more-actions.h
+++ b/include/gmock/gmock-more-actions.h
@@ -72,7 +72,7 @@ template <class Class, typename MethodPtr>
class InvokeMethodAction {
public:
InvokeMethodAction(Class* obj_ptr, MethodPtr method_ptr)
- : obj_ptr_(obj_ptr), method_ptr_(method_ptr) {}
+ : method_ptr_(method_ptr), obj_ptr_(obj_ptr) {}
template <typename Result, typename ArgumentTuple>
Result Perform(const ArgumentTuple& args) const {
@@ -81,8 +81,11 @@ class InvokeMethodAction {
}
private:
- Class* const obj_ptr_;
+ // The order of these members matters. Reversing the order can trigger
+ // warning C4121 in MSVC (see
+ // http://computer-programming-forum.com/7-vc.net/6fbc30265f860ad1.htm ).
const MethodPtr method_ptr_;
+ Class* const obj_ptr_;
GTEST_DISALLOW_ASSIGN_(InvokeMethodAction);
};