diff options
author | zhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386> | 2013-04-24 02:49:43 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386> | 2013-04-24 02:49:43 +0000 |
commit | f4274520da256a3e8dd4fe2aa2e714f44ad89d18 (patch) | |
tree | 3776c14250f66f840ff9706e0a37aa71e4aebda2 /include | |
parent | 061f1d4d167a0c118ae653516770e9d78bab320e (diff) | |
download | googletest-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.h | 6 |
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(); |