Comment #1 on issue 373 by Tests hang/crash/don't pass without RTTI

In fact, tests didn't even compile:

google/protobuf/ error: "dynamic_cast" not permitted with -fno-rtti

I made the following change to fix compile error:

--- a/src/google/protobuf/
+++ b/src/google/protobuf/
@@ -615,7 +615,8 @@ TEST(ExtensionSetTest, DynamicExtensions) {
     const Message& sub_message =
         message.GetReflection()->GetMessage(message, message_extension);
     const unittest::ForeignMessage* typed_sub_message =
-        dynamic_cast<const unittest::ForeignMessage*>(&sub_message);
+        ::google::protobuf::internal::dynamic_cast_if_available
+        <const unittest::ForeignMessage*>(&sub_message);
     ASSERT_TRUE(typed_sub_message != NULL);
     EXPECT_EQ(456, typed_sub_message->c());

Is GOOGLE_PROTOBUF_NO_RTTI supported at all?

You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to