Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
gmock_matchers_test.cc doesn’t build with RTTI off #610
When RTTI is disabled (-fno-rtti) gmock_matchers_test.cc fails to build, even though GTEST_HAS_RTTI is 0:
In file included from …/googlemock/test/gmock-matchers_test.cc:36:
This is repeated several more times for other uses of WhenDynamicCastTo<>.
I’m in favor of leaving WhenDynamicCastTo<> broken when RTTI is off, or disabling it entirely by wrapping it in #if GTEST_HAS_RTTI in gmock-matchers.h. In either case, all of the WhenDynamicCastToTest tests in gmock-matchers_test.cc should be disabled when GTEST_HAS_RTTI is 0.
Since WhenDynamicCastToTest.Describe already considers GTEST_HAS_RTTI, albeit in a way that can’t possibly work or pass, I’m not sure what was intended here.