diff --git a/include/gmock/gmock-generated-actions.h b/include/gmock/gmock-generated-actions.h index 60b5dc57..e3f3dc27 100644 --- a/include/gmock/gmock-generated-actions.h +++ b/include/gmock/gmock-generated-actions.h @@ -1557,6 +1557,20 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, // To learn more about using these macros, please search for 'ACTION' // on http://code.google.com/p/googlemock/wiki/CookBook. +// An internal macro needed for implementing ACTION*(). +#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\ + const args_type& args GTEST_ATTRIBUTE_UNUSED_,\ + arg0_type arg0 GTEST_ATTRIBUTE_UNUSED_,\ + arg1_type arg1 GTEST_ATTRIBUTE_UNUSED_,\ + arg2_type arg2 GTEST_ATTRIBUTE_UNUSED_,\ + arg3_type arg3 GTEST_ATTRIBUTE_UNUSED_,\ + arg4_type arg4 GTEST_ATTRIBUTE_UNUSED_,\ + arg5_type arg5 GTEST_ATTRIBUTE_UNUSED_,\ + arg6_type arg6 GTEST_ATTRIBUTE_UNUSED_,\ + arg7_type arg7 GTEST_ATTRIBUTE_UNUSED_,\ + arg8_type arg8 GTEST_ATTRIBUTE_UNUSED_,\ + arg9_type arg9 GTEST_ATTRIBUTE_UNUSED_ + #define ACTION(name)\ class name##Action {\ public:\ @@ -1595,11 +1609,8 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, typename arg6_type, typename arg7_type, typename arg8_type, \ typename arg9_type>\ typename ::testing::internal::Function::Result\ - name##Action::\ - gmock_Impl::gmock_PerformImpl(const args_type& args, \ - arg0_type arg0, arg1_type arg1, arg2_type arg2, arg3_type arg3, \ - arg4_type arg4, arg5_type arg5, arg6_type arg6, arg7_type arg7, \ - arg8_type arg8, arg9_type arg9) const + name##Action::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const #define ACTION_P(name, p0)\ template \ @@ -1644,11 +1655,8 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, typename arg6_type, typename arg7_type, typename arg8_type, \ typename arg9_type>\ typename ::testing::internal::Function::Result\ - name##ActionP::\ - gmock_Impl::gmock_PerformImpl(const args_type& args, \ - arg0_type arg0, arg1_type arg1, arg2_type arg2, arg3_type arg3, \ - arg4_type arg4, arg5_type arg5, arg6_type arg6, arg7_type arg7, \ - arg8_type arg8, arg9_type arg9) const + name##ActionP::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const #define ACTION_P2(name, p0, p1)\ template \ @@ -1698,11 +1706,8 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, typename arg6_type, typename arg7_type, typename arg8_type, \ typename arg9_type>\ typename ::testing::internal::Function::Result\ - name##ActionP2::\ - gmock_Impl::gmock_PerformImpl(const args_type& args, \ - arg0_type arg0, arg1_type arg1, arg2_type arg2, arg3_type arg3, \ - arg4_type arg4, arg5_type arg5, arg6_type arg6, arg7_type arg7, \ - arg8_type arg8, arg9_type arg9) const + name##ActionP2::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const #define ACTION_P3(name, p0, p1, p2)\ template \ @@ -1754,11 +1759,9 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, typename arg6_type, typename arg7_type, typename arg8_type, \ typename arg9_type>\ typename ::testing::internal::Function::Result\ - name##ActionP3::\ - gmock_Impl::gmock_PerformImpl(const args_type& args, \ - arg0_type arg0, arg1_type arg1, arg2_type arg2, arg3_type arg3, \ - arg4_type arg4, arg5_type arg5, arg6_type arg6, arg7_type arg7, \ - arg8_type arg8, arg9_type arg9) const + name##ActionP3::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const #define ACTION_P4(name, p0, p1, p2, p3)\ template \ typename ::testing::internal::Function::Result\ - name##ActionP4::\ - gmock_Impl::gmock_PerformImpl(const args_type& args, \ - arg0_type arg0, arg1_type arg1, arg2_type arg2, arg3_type arg3, \ - arg4_type arg4, arg5_type arg5, arg6_type arg6, arg7_type arg7, \ - arg8_type arg8, arg9_type arg9) const + name##ActionP4::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const #define ACTION_P5(name, p0, p1, p2, p3, p4)\ template \ typename ::testing::internal::Function::Result\ - name##ActionP5::\ - gmock_Impl::gmock_PerformImpl(const args_type& args, \ - arg0_type arg0, arg1_type arg1, arg2_type arg2, arg3_type arg3, \ - arg4_type arg4, arg5_type arg5, arg6_type arg6, arg7_type arg7, \ - arg8_type arg8, arg9_type arg9) const + name##ActionP5::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const #define ACTION_P6(name, p0, p1, p2, p3, p4, p5)\ template \ typename ::testing::internal::Function::Result\ name##ActionP6::\ - gmock_Impl::gmock_PerformImpl(const args_type& args, \ - arg0_type arg0, arg1_type arg1, arg2_type arg2, arg3_type arg3, \ - arg4_type arg4, arg5_type arg5, arg6_type arg6, arg7_type arg7, \ - arg8_type arg8, arg9_type arg9) const + p5##_type>::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const #define ACTION_P7(name, p0, p1, p2, p3, p4, p5, p6)\ template \ typename ::testing::internal::Function::Result\ name##ActionP7::\ - gmock_Impl::gmock_PerformImpl(const args_type& args, \ - arg0_type arg0, arg1_type arg1, arg2_type arg2, arg3_type arg3, \ - arg4_type arg4, arg5_type arg5, arg6_type arg6, arg7_type arg7, \ - arg8_type arg8, arg9_type arg9) const + p5##_type, p6##_type>::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const #define ACTION_P8(name, p0, p1, p2, p3, p4, p5, p6, p7)\ template \ typename ::testing::internal::Function::Result\ name##ActionP8::\ - gmock_Impl::gmock_PerformImpl(const args_type& args, \ - arg0_type arg0, arg1_type arg1, arg2_type arg2, arg3_type arg3, \ - arg4_type arg4, arg5_type arg5, arg6_type arg6, arg7_type arg7, \ - arg8_type arg8, arg9_type arg9) const + p5##_type, p6##_type, \ + p7##_type>::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const #define ACTION_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8)\ template \ typename ::testing::internal::Function::Result\ name##ActionP9::\ - gmock_Impl::gmock_PerformImpl(const args_type& args, \ - arg0_type arg0, arg1_type arg1, arg2_type arg2, arg3_type arg3, \ - arg4_type arg4, arg5_type arg5, arg6_type arg6, arg7_type arg7, \ - arg8_type arg8, arg9_type arg9) const + p5##_type, p6##_type, p7##_type, \ + p8##_type>::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const #define ACTION_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)\ template \ typename ::testing::internal::Function::Result\ name##ActionP10::\ - gmock_Impl::gmock_PerformImpl(const args_type& args, \ - arg0_type arg0, arg1_type arg1, arg2_type arg2, arg3_type arg3, \ - arg4_type arg4, arg5_type arg5, arg6_type arg6, arg7_type arg7, \ - arg8_type arg8, arg9_type arg9) const + p5##_type, p6##_type, p7##_type, p8##_type, \ + p9##_type>::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const // TODO(wan@google.com): move the following to a different .h file // such that we don't have to run 'pump' every time the code is diff --git a/include/gmock/gmock-generated-actions.h.pump b/include/gmock/gmock-generated-actions.h.pump index 3854279e..67359e64 100644 --- a/include/gmock/gmock-generated-actions.h.pump +++ b/include/gmock/gmock-generated-actions.h.pump @@ -709,6 +709,15 @@ $range j2 2..i // on http://code.google.com/p/googlemock/wiki/CookBook. $range i 0..n +$range k 0..n-1 + +// An internal macro needed for implementing ACTION*(). +#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\ + const args_type& args GTEST_ATTRIBUTE_UNUSED_ +$for k [[,\ + arg$k[[]]_type arg$k GTEST_ATTRIBUTE_UNUSED_]] + + $for i [[ @@ -735,7 +744,6 @@ $var param_field_decls2 = [[$for j ]]]] $var params = [[$for j, [[p$j]]]] $var param_types = [[$if i==0 [[]] $else [[<$for j, [[p$j##_type]]>]]]] -$range k 0..n-1 $var typename_arg_types = [[$for k, [[typename arg$k[[]]_type]]]] $var arg_types_and_names = [[$for k, [[arg$k[[]]_type arg$k]]]] $var macro_name = [[$if i==0 [[ACTION]] $elif i==1 [[ACTION_P]] @@ -771,9 +779,8 @@ $arg_types_and_names) const;\$param_field_decls template \ template <$typename_arg_types>\ typename ::testing::internal::Function::Result\ - $class_name$param_types::\ - gmock_Impl::gmock_PerformImpl(const args_type& args, [[]] -$arg_types_and_names) const + $class_name$param_types::gmock_Impl::gmock_PerformImpl(\ + GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const ]] $$ } // This meta comment fixes auto-indentation in Emacs. It won't $$ // show up in the generated code. diff --git a/make/Makefile b/make/Makefile index 0c30ebfc..ee0527e1 100644 --- a/make/Makefile +++ b/make/Makefile @@ -31,7 +31,7 @@ CPPFLAGS += -I$(GMOCK_DIR) -I$(GMOCK_DIR)/include \ -I$(GTEST_DIR) -I$(GTEST_DIR)/include # Flags passed to the C++ compiler. -CXXFLAGS += -g -Wall -Wextra -Wno-unused-parameter +CXXFLAGS += -g -Wall -Wextra # All tests produced by this Makefile. Remember to add new tests you # created to the list.