aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2011-03-09 01:18:08 +0000
committerzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2011-03-09 01:18:08 +0000
commitfc8c6c479a5250b709ed7b4406e025439037e18e (patch)
treedaa8a90d0daedfaad62196bec42c63646f19f21d /include
parent62a35fbc5d316c4f82f37cb6e183eb8de210a94c (diff)
downloadgoogletest-fc8c6c479a5250b709ed7b4406e025439037e18e.tar.gz
googletest-fc8c6c479a5250b709ed7b4406e025439037e18e.tar.bz2
googletest-fc8c6c479a5250b709ed7b4406e025439037e18e.zip
Disables SetArgPointee("string literal") for GCC 4.0- and Symbian, and
adds support for SetArgPointee(L"wide string literal") -- by Vlad Losev.
Diffstat (limited to 'include')
-rw-r--r--include/gmock/gmock-actions.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/gmock/gmock-actions.h b/include/gmock/gmock-actions.h
index cfd5850e..d6a3e148 100644
--- a/include/gmock/gmock-actions.h
+++ b/include/gmock/gmock-actions.h
@@ -981,7 +981,11 @@ SetArgPointee(const T& x) {
return MakePolymorphicAction(internal::SetArgumentPointeeAction<
N, T, internal::IsAProtocolMessage<T>::value>(x));
}
+
+#if !((GTEST_GCC_VER_ && GTEST_GCC_VER_ < 40000) || GTEST_OS_SYMBIAN)
// This overload allows SetArgPointee() to accept a string literal.
+// GCC prior to the version 4.0 and Symbian C++ compiler cannot distinguish
+// this overload from the templated version and emit a compile error.
template <size_t N>
PolymorphicAction<
internal::SetArgumentPointeeAction<N, const char*, false> >
@@ -989,6 +993,16 @@ SetArgPointee(const char* p) {
return MakePolymorphicAction(internal::SetArgumentPointeeAction<
N, const char*, false>(p));
}
+
+template <size_t N>
+PolymorphicAction<
+ internal::SetArgumentPointeeAction<N, const wchar_t*, false> >
+SetArgPointee(const wchar_t* p) {
+ return MakePolymorphicAction(internal::SetArgumentPointeeAction<
+ N, const wchar_t*, false>(p));
+}
+#endif
+
// The following version is DEPRECATED.
template <size_t N, typename T>
PolymorphicAction<