diff options
Diffstat (limited to 'googlemock/include')
-rw-r--r-- | googlemock/include/gmock/gmock-spec-builders.h | 6 | ||||
-rw-r--r-- | googlemock/include/gmock/internal/gmock-internal-utils.h | 23 |
2 files changed, 3 insertions, 26 deletions
diff --git a/googlemock/include/gmock/gmock-spec-builders.h b/googlemock/include/gmock/gmock-spec-builders.h index 735a3bc..0d1adda 100644 --- a/googlemock/include/gmock/gmock-spec-builders.h +++ b/googlemock/include/gmock/gmock-spec-builders.h @@ -67,6 +67,7 @@ #include <set> #include <sstream> #include <string> +#include <type_traits> #include <utility> #include <vector> #include "gmock/gmock-actions.h" @@ -1653,9 +1654,8 @@ class FunctionMocker<R(Args...)> final : public UntypedFunctionMockerBase { const OnCallSpec<F>* const spec = FindOnCallSpec(args); if (spec == nullptr) { - *os << (internal::type_equals<Result, void>::value ? - "returning directly.\n" : - "returning default value.\n"); + *os << (std::is_void<Result>::value ? "returning directly.\n" + : "returning default value.\n"); } else { *os << "taking default action specified at:\n" << FormatFileLocation(spec->file(), spec->line()) << "\n"; diff --git a/googlemock/include/gmock/internal/gmock-internal-utils.h b/googlemock/include/gmock/internal/gmock-internal-utils.h index b7d2cf2..05d37d5 100644 --- a/googlemock/include/gmock/internal/gmock-internal-utils.h +++ b/googlemock/include/gmock/internal/gmock-internal-utils.h @@ -106,25 +106,6 @@ inline Element* GetRawPointer(Element* p) { return p; } # define GMOCK_WCHAR_T_IS_NATIVE_ 1 #endif -// signed wchar_t and unsigned wchar_t are NOT in the C++ standard. -// Using them is a bad practice and not portable. So DON'T use them. -// -// Still, Google Mock is designed to work even if the user uses signed -// wchar_t or unsigned wchar_t (obviously, assuming the compiler -// supports them). -// -// To gcc, -// wchar_t == signed wchar_t != unsigned wchar_t == unsigned int -// -// gcc-9 appears to treat signed/unsigned wchar_t as ill-formed -// regardless of the signage of its underlying type. -#ifdef __GNUC__ -#if !defined(__WCHAR_UNSIGNED__) && (__GNUC__ < 9) -// signed/unsigned wchar_t are valid types. -# define GMOCK_HAS_SIGNED_WCHAR_T_ 1 -#endif -#endif - // In what follows, we use the term "kind" to indicate whether a type // is bool, an integer type (excluding bool), a floating-point type, // or none of them. This categorization is useful for determining @@ -355,10 +336,6 @@ GTEST_API_ WithoutMatchers GetWithoutMatchers(); // Type traits. -// type_equals<T1, T2>::value is non-zero if T1 and T2 are the same type. -template <typename T1, typename T2> struct type_equals : public false_type {}; -template <typename T> struct type_equals<T, T> : public true_type {}; - // remove_reference<T>::type removes the reference from type T, if any. template <typename T> struct remove_reference { typedef T type; }; // NOLINT template <typename T> struct remove_reference<T&> { typedef T type; }; // NOLINT |