aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/include
diff options
context:
space:
mode:
authorGennadiy Civil <gennadiycivil@users.noreply.github.com>2018-05-22 06:00:40 -0700
committerGitHub <noreply@github.com>2018-05-22 06:00:40 -0700
commit8276dbae6fb1016cf9829f2e790fade17967a6d4 (patch)
tree8114a072d0722277a5fcf6849659c058bf61ca48 /googlemock/include
parent1814bed8ec04439116a05e723b9189226e556922 (diff)
parent3b22e21cc85f19e9210da139e0f987c441a29138 (diff)
downloadgoogletest-8276dbae6fb1016cf9829f2e790fade17967a6d4.tar.gz
googletest-8276dbae6fb1016cf9829f2e790fade17967a6d4.tar.bz2
googletest-8276dbae6fb1016cf9829f2e790fade17967a6d4.zip
Merge pull request #1591 from sgraham/disabled-rtti
Fix gmock not building when -fno-rtti
Diffstat (limited to 'googlemock/include')
-rw-r--r--googlemock/include/gmock/gmock-matchers.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h
index e0a78646..c94f5826 100644
--- a/googlemock/include/gmock/gmock-matchers.h
+++ b/googlemock/include/gmock/gmock-matchers.h
@@ -2371,6 +2371,7 @@ class PointeeMatcher {
GTEST_DISALLOW_ASSIGN_(PointeeMatcher);
};
+#if GTEST_HAS_RTTI
// Implements the WhenDynamicCastTo<T>(m) matcher that matches a pointer or
// reference that matches inner_matcher when dynamic_cast<T> is applied.
// The result of dynamic_cast<To> is forwarded to the inner matcher.
@@ -2397,11 +2398,7 @@ class WhenDynamicCastToMatcherBase {
const Matcher<To> matcher_;
static std::string GetToName() {
-#if GTEST_HAS_RTTI
return GetTypeName<To>();
-#else // GTEST_HAS_RTTI
- return "the target type";
-#endif // GTEST_HAS_RTTI
}
private:
@@ -2447,6 +2444,7 @@ class WhenDynamicCastToMatcher<To&> : public WhenDynamicCastToMatcherBase<To&> {
return MatchPrintAndExplain(*to, this->matcher_, listener);
}
};
+#endif // GTEST_HAS_RTTI
// Implements the Field() matcher for matching a field (i.e. member
// variable) of an object.
@@ -4441,6 +4439,7 @@ inline internal::PointeeMatcher<InnerMatcher> Pointee(
return internal::PointeeMatcher<InnerMatcher>(inner_matcher);
}
+#if GTEST_HAS_RTTI
// Creates a matcher that matches a pointer or reference that matches
// inner_matcher when dynamic_cast<To> is applied.
// The result of dynamic_cast<To> is forwarded to the inner matcher.
@@ -4453,6 +4452,7 @@ WhenDynamicCastTo(const Matcher<To>& inner_matcher) {
return MakePolymorphicMatcher(
internal::WhenDynamicCastToMatcher<To>(inner_matcher));
}
+#endif // GTEST_HAS_RTTI
// Creates a matcher that matches an object whose given field matches
// 'matcher'. For example,