Raw access to oneof LazyField must be LazyField*.

PiperOrigin-RevId: 612961986
pull/16050/head
Protobuf Team Bot 9 months ago committed by Copybara-Service
parent 507f037f7e
commit 6789e66766
  1. 1
      src/google/protobuf/reflection_visit_field_info.h
  2. 8
      src/google/protobuf/reflection_visit_fields_test.cc

@ -73,6 +73,7 @@ class iterator_range {
#ifdef __cpp_if_constexpr
template <bool is_oneof>
struct DynamicFieldInfoHelper {
template <typename T>

@ -33,6 +33,7 @@ using ::protobuf_unittest::NestedTestAllTypes;
using ::protobuf_unittest::TestAllExtensions;
using ::protobuf_unittest::TestAllTypes;
using ::protobuf_unittest::TestMap;
using ::protobuf_unittest::TestOneof2;
using ::protobuf_unittest::TestPackedExtensions;
using ::protobuf_unittest::TestPackedTypes;
using ::proto2_wireformat_unittest::TestMessageSet;
@ -328,6 +329,13 @@ INSTANTIATE_TEST_SUITE_P(
parsed->ParseFromString(original->SerializeAsString()));
return parsed;
}},
TestParam{"TestOneof2LazyField",
[](Arena& arena) -> Message* {
auto* msg = Arena::Create<TestOneof2>(&arena);
TestUtil::SetOneof2(msg);
msg->mutable_foo_lazy_message()->set_moo_int(0);
return msg;
}},
TestParam{"TestPacked",
[](Arena& arena) -> Message* {
auto* msg = Arena::Create<TestPackedTypes>(&arena);

Loading…
Cancel
Save