aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2013-04-24 02:49:43 +0000
committerzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2013-04-24 02:49:43 +0000
commitf4274520da256a3e8dd4fe2aa2e714f44ad89d18 (patch)
tree3776c14250f66f840ff9706e0a37aa71e4aebda2 /include
parent061f1d4d167a0c118ae653516770e9d78bab320e (diff)
downloadgoogletest-f4274520da256a3e8dd4fe2aa2e714f44ad89d18.tar.gz
googletest-f4274520da256a3e8dd4fe2aa2e714f44ad89d18.tar.bz2
googletest-f4274520da256a3e8dd4fe2aa2e714f44ad89d18.zip
Makes EXPECT_THAT typesafe; updates CHANGES for 1.7.0; pulls in gtest r653
Diffstat (limited to 'include')
-rw-r--r--include/gmock/gmock-matchers.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/gmock/gmock-matchers.h b/include/gmock/gmock-matchers.h
index 962cfde9..d4977273 100644
--- a/include/gmock/gmock-matchers.h
+++ b/include/gmock/gmock-matchers.h
@@ -1613,10 +1613,12 @@ class PredicateFormatterFromMatcher {
// know which type to instantiate it to until we actually see the
// type of x here.
//
- // We write MatcherCast<const T&>(matcher_) instead of
+ // We write SafeMatcherCast<const T&>(matcher_) instead of
// Matcher<const T&>(matcher_), as the latter won't compile when
// matcher_ has type Matcher<T> (e.g. An<int>()).
- const Matcher<const T&> matcher = MatcherCast<const T&>(matcher_);
+ // We don't write MatcherCast<const T&> either, as that allows
+ // potentially unsafe downcasting of the matcher argument.
+ const Matcher<const T&> matcher = SafeMatcherCast<const T&>(matcher_);
StringMatchResultListener listener;
if (MatchPrintAndExplain(x, matcher, &listener))
return AssertionSuccess();