From 572e261b607585d7044ad3321f9530d5c14a2564 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Fri, 31 Jan 2020 12:03:06 -0500 Subject: Googletest export Fix use of reserved names. Minimize code duplication needed for explict-vs-nonexplicit constructor. PiperOrigin-RevId: 292555014 --- .../include/gmock/gmock-generated-matchers.h | 44 ++++++---------------- .../include/gmock/gmock-generated-matchers.h.pump | 3 +- googlemock/include/gmock/gmock-matchers.h | 28 +++++--------- googlemock/test/gmock-matchers_test.cc | 27 +++++++++++++ 4 files changed, 48 insertions(+), 54 deletions(-) (limited to 'googlemock') diff --git a/googlemock/include/gmock/gmock-generated-matchers.h b/googlemock/include/gmock/gmock-generated-matchers.h index 346b145e..539d6570 100644 --- a/googlemock/include/gmock/gmock-generated-matchers.h +++ b/googlemock/include/gmock/gmock-generated-matchers.h @@ -50,10 +50,8 @@ #define GMOCK_INTERNAL_MATCHER(name, description)\ class name##Matcher : public \ ::testing::internal::MatcherBaseImpl {\ - using __internal_base_type = \ - ::testing::internal::MatcherBaseImpl;\ public:\ - using __internal_base_type::__internal_base_type;\ + using name##Matcher::MatcherBaseImpl::MatcherBaseImpl;\ template \ class gmock_Impl : public ::testing::MatcherInterface<\ GTEST_REFERENCE_TO_CONST_(arg_type)> {\ @@ -95,10 +93,8 @@ template \ class name##MatcherP : public \ ::testing::internal::MatcherBaseImpl> {\ - using __internal_base_type = \ - ::testing::internal::MatcherBaseImpl;\ public:\ - using __internal_base_type::__internal_base_type;\ + using name##MatcherP::MatcherBaseImpl::MatcherBaseImpl;\ template \ class gmock_Impl : public ::testing::MatcherInterface<\ GTEST_REFERENCE_TO_CONST_(arg_type)> {\ @@ -144,10 +140,8 @@ class name##MatcherP2 : public \ ::testing::internal::MatcherBaseImpl> {\ - using __internal_base_type = \ - ::testing::internal::MatcherBaseImpl;\ public:\ - using __internal_base_type::__internal_base_type;\ + using name##MatcherP2::MatcherBaseImpl::MatcherBaseImpl;\ template \ class gmock_Impl : public ::testing::MatcherInterface<\ GTEST_REFERENCE_TO_CONST_(arg_type)> {\ @@ -196,10 +190,8 @@ class name##MatcherP3 : public \ ::testing::internal::MatcherBaseImpl> {\ - using __internal_base_type = \ - ::testing::internal::MatcherBaseImpl;\ public:\ - using __internal_base_type::__internal_base_type;\ + using name##MatcherP3::MatcherBaseImpl::MatcherBaseImpl;\ template \ class gmock_Impl : public ::testing::MatcherInterface<\ GTEST_REFERENCE_TO_CONST_(arg_type)> {\ @@ -251,10 +243,8 @@ class name##MatcherP4 : public \ ::testing::internal::MatcherBaseImpl> {\ - using __internal_base_type = \ - ::testing::internal::MatcherBaseImpl;\ public:\ - using __internal_base_type::__internal_base_type;\ + using name##MatcherP4::MatcherBaseImpl::MatcherBaseImpl;\ template \ class gmock_Impl : public ::testing::MatcherInterface<\ GTEST_REFERENCE_TO_CONST_(arg_type)> {\ @@ -313,10 +303,8 @@ class name##MatcherP5 : public \ ::testing::internal::MatcherBaseImpl> {\ - using __internal_base_type = \ - ::testing::internal::MatcherBaseImpl;\ public:\ - using __internal_base_type::__internal_base_type;\ + using name##MatcherP5::MatcherBaseImpl::MatcherBaseImpl;\ template \ class gmock_Impl : public ::testing::MatcherInterface<\ GTEST_REFERENCE_TO_CONST_(arg_type)> {\ @@ -377,10 +365,8 @@ class name##MatcherP6 : public \ ::testing::internal::MatcherBaseImpl> {\ - using __internal_base_type = \ - ::testing::internal::MatcherBaseImpl;\ public:\ - using __internal_base_type::__internal_base_type;\ + using name##MatcherP6::MatcherBaseImpl::MatcherBaseImpl;\ template \ class gmock_Impl : public ::testing::MatcherInterface<\ GTEST_REFERENCE_TO_CONST_(arg_type)> {\ @@ -444,10 +430,8 @@ class name##MatcherP7 : public \ ::testing::internal::MatcherBaseImpl> {\ - using __internal_base_type = \ - ::testing::internal::MatcherBaseImpl;\ public:\ - using __internal_base_type::__internal_base_type;\ + using name##MatcherP7::MatcherBaseImpl::MatcherBaseImpl;\ template \ class gmock_Impl : public ::testing::MatcherInterface<\ GTEST_REFERENCE_TO_CONST_(arg_type)> {\ @@ -519,10 +503,8 @@ ::testing::internal::MatcherBaseImpl> {\ - using __internal_base_type = \ - ::testing::internal::MatcherBaseImpl;\ public:\ - using __internal_base_type::__internal_base_type;\ + using name##MatcherP8::MatcherBaseImpl::MatcherBaseImpl;\ template \ class gmock_Impl : public ::testing::MatcherInterface<\ GTEST_REFERENCE_TO_CONST_(arg_type)> {\ @@ -597,10 +579,8 @@ ::testing::internal::MatcherBaseImpl> {\ - using __internal_base_type = \ - ::testing::internal::MatcherBaseImpl;\ public:\ - using __internal_base_type::__internal_base_type;\ + using name##MatcherP9::MatcherBaseImpl::MatcherBaseImpl;\ template \ class gmock_Impl : public ::testing::MatcherInterface<\ GTEST_REFERENCE_TO_CONST_(arg_type)> {\ @@ -679,10 +659,8 @@ ::testing::internal::MatcherBaseImpl> {\ - using __internal_base_type = \ - ::testing::internal::MatcherBaseImpl;\ public:\ - using __internal_base_type::__internal_base_type;\ + using name##MatcherP10::MatcherBaseImpl::MatcherBaseImpl;\ template \ class gmock_Impl : public ::testing::MatcherInterface<\ GTEST_REFERENCE_TO_CONST_(arg_type)> {\ diff --git a/googlemock/include/gmock/gmock-generated-matchers.h.pump b/googlemock/include/gmock/gmock-generated-matchers.h.pump index fc0ffdcf..0ea3aad9 100644 --- a/googlemock/include/gmock/gmock-generated-matchers.h.pump +++ b/googlemock/include/gmock/gmock-generated-matchers.h.pump @@ -80,9 +80,8 @@ $var param_field_decls2 = [[$for j #define $macro_name(name, description$for j [[, p$j]])\$template 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;\ + using $class_name::MatcherBaseImpl::MatcherBaseImpl;\ template \ class gmock_Impl : public ::testing::MatcherInterface<\ GTEST_REFERENCE_TO_CONST_(arg_type)> {\ diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index 22211210..473b3aa8 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -462,28 +462,18 @@ class MatcherBaseImpl { } }; -// Template specialization for Matcher with 1 parameter. -template