diff options
author | Abseil Team <absl-team@google.com> | 2020-01-24 19:09:22 (GMT) |
---|---|---|
committer | Xiaoyi Zhang <zhangxy@google.com> | 2020-01-24 20:30:34 (GMT) |
commit | 32e31b833a1af8e968a17aced7888a0c7a2f0232 (patch) | |
tree | 1c1c1cd9c86bfef54a7f9a5406ce1bb3377ecd68 /googlemock/include/gmock/gmock-generated-matchers.h.pump | |
parent | 763d979913a9a602899d8da711398ef6e1b3b78a (diff) | |
download | googletest-32e31b833a1af8e968a17aced7888a0c7a2f0232.zip googletest-32e31b833a1af8e968a17aced7888a0c7a2f0232.tar.gz googletest-32e31b833a1af8e968a17aced7888a0c7a2f0232.tar.bz2 |
Export Test - Do Not Mergerefs/pull/2684/head8EA412EE54E54CAC6E49EE3B7C209DA1
Move part of functionality of Matcher* class to the base one. Reduce copypaste.
Make constructor and conversion operator of Matcher* class independent of pump.
PiperOrigin-RevId: 291405510
Diffstat (limited to 'googlemock/include/gmock/gmock-generated-matchers.h.pump')
-rw-r--r-- | googlemock/include/gmock/gmock-generated-matchers.h.pump | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/googlemock/include/gmock/gmock-generated-matchers.h.pump b/googlemock/include/gmock/gmock-generated-matchers.h.pump index 69d2ae4..54e3ca3 100644 --- a/googlemock/include/gmock/gmock-generated-matchers.h.pump +++ b/googlemock/include/gmock/gmock-generated-matchers.h.pump @@ -275,10 +275,8 @@ $var template = [[$if i==0 [[]] $else [[ template <$for j, [[typename p$j##_type]]>\ ]]]] -$var ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]] $var impl_ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]] $var impl_inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::std::move(gmock_p$j))]]]]]] -$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::std::move(gmock_p$j))]]]]]] $var params = [[$for j, [[p$j]]]] $var param_types = [[$if i==0 [[]] $else [[<$for j, [[p$j##_type]]>]]]] $var param_types_and_names = [[$for j, [[p$j##_type p$j]]]] @@ -294,8 +292,10 @@ $var param_field_decls2 = [[$for j ]]]] #define $macro_name(name$for j [[, p$j]], description)\$template - class $class_name {\ + class $class_name : public ::testing::internal::MatcherBaseImpl<$class_name$param_types> {\ + using __internal_base_type = ::testing::internal::MatcherBaseImpl<$class_name>;\ public:\ + using __internal_base_type::__internal_base_type;\ template <typename arg_type>\ class gmock_Impl : public ::testing::MatcherInterface<\ GTEST_REFERENCE_TO_CONST_(arg_type)> {\ @@ -323,14 +323,6 @@ $var param_field_decls2 = [[$for j ::std::tuple<$for j, [[p$j##_type]]>($for j, [[p$j]])));\ }\ };\ - template <typename arg_type>\ - operator ::testing::Matcher<arg_type>() const {\ - return ::testing::Matcher<arg_type>(\ - new gmock_Impl<arg_type>($params));\ - }\ - [[$if i==1 [[explicit ]]]]$class_name($ctor_param_list)$inits {\ - }\$param_field_decls2 - private:\ };\$template inline $class_name$param_types name($param_types_and_names) {\ return $class_name$param_types($params);\ |