Makes EXPECT_THAT typesafe; updates CHANGES for 1.7.0; pulls in gtest r653

This commit is contained in:
zhanyong.wan
2013-04-24 02:49:43 +00:00
parent 061f1d4d16
commit f4274520da
3 changed files with 34 additions and 3 deletions

View File

@@ -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();