Skip to content

Commit

Permalink
Migrate users of dynamic_cast/down_cast on protobuf types to use prot…
Browse files Browse the repository at this point in the history
…obuf cast functions instead. These do not require RTTI to work.

PiperOrigin-RevId: 638352213
  • Loading branch information
pybind11_protobuf authors authored and copybara-github committed May 29, 2024
1 parent 1d7a729 commit bb906ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pybind11_protobuf/proto_caster_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct proto_caster_load_impl {
const ::google::protobuf::Message *message =
pybind11_protobuf::PyProtoGetCppMessagePointer(src);
if (message) {
value = dynamic_cast<const ProtoType *>(message);
value = ::google::protobuf::DynamicCastToGenerated<ProtoType>(message);
if (value) {
// If the capability were available, then we could probe PyProto_API and
// allow c++ mutability based on the python reference count.
Expand Down

0 comments on commit bb906ff

Please sign in to comment.