Skip to content

Commit af8ee51

Browse files
pybind11_protobuf authorscopybara-github
authored andcommitted
Migrate users of dynamic_cast/down_cast on protobuf types to use protobuf cast functions instead. These do not require RTTI to work.
PiperOrigin-RevId: 638398786
1 parent 1d7a729 commit af8ee51

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pybind11_protobuf/proto_caster_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ struct proto_caster_load_impl {
5555
const ::google::protobuf::Message *message =
5656
pybind11_protobuf::PyProtoGetCppMessagePointer(src);
5757
if (message) {
58-
value = dynamic_cast<const ProtoType *>(message);
58+
value = ::google::protobuf::DynamicCastToGenerated<ProtoType>(message);
5959
if (value) {
6060
// If the capability were available, then we could probe PyProto_API and
6161
// allow c++ mutability based on the python reference count.

0 commit comments

Comments
 (0)