Skip to content

Commit cd07af2

Browse files
jckingcopybara-github
authored andcommitted
Workaround Clang-CL compiler bug
PiperOrigin-RevId: 994393040
1 parent 9e75d37 commit cd07af2

2 files changed

Lines changed: 14 additions & 16 deletions

File tree

‎internal/BUILD‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,6 @@ cc_library(
811811
":number",
812812
":status_macros",
813813
":well_known_types",
814-
"//common:memory",
815814
"//extensions/protobuf/internal:map_reflection",
816815
"@com_google_absl//absl/base:core_headers",
817816
"@com_google_absl//absl/base:nullability",

‎internal/message_equality.cc‎

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include "absl/strings/string_view.h"
3434
#include "absl/time/time.h"
3535
#include "absl/types/variant.h"
36-
#include "common/memory.h"
3736
#include "extensions/protobuf/internal/map_reflection.h"
3837
#include "internal/json.h"
3938
#include "internal/number.h"
@@ -846,7 +845,7 @@ class MessageEqualsState final {
846845
well_known_types::UnpackAnyIfResolveable(
847846
&arena_, lhs_reflection_.any_reflection, lhs, pool_, factory_));
848847
if (lhs_unpacked) {
849-
lhs_ptr = cel::to_address(lhs_unpacked);
848+
lhs_ptr = lhs_unpacked.get();
850849
lhs_descriptor = lhs_ptr->GetDescriptor();
851850
lhs_well_known_type = lhs_descriptor->well_known_type();
852851
}
@@ -857,7 +856,7 @@ class MessageEqualsState final {
857856
well_known_types::UnpackAnyIfResolveable(
858857
&arena_, rhs_reflection_.any_reflection, rhs, pool_, factory_));
859858
if (rhs_unpacked) {
860-
rhs_ptr = cel::to_address(rhs_unpacked);
859+
rhs_ptr = rhs_unpacked.get();
861860
rhs_descriptor = rhs_ptr->GetDescriptor();
862861
rhs_well_known_type = rhs_descriptor->well_known_type();
863862
}
@@ -1017,7 +1016,7 @@ class MessageEqualsState final {
10171016
lhs.GetReflection()->GetMessage(lhs, lhs_field),
10181017
pool_, factory_));
10191018
if (lhs_unpacked) {
1020-
lhs_ptr = cel::to_address(lhs_unpacked);
1019+
lhs_ptr = lhs_unpacked.get();
10211020
lhs_field = nullptr;
10221021
}
10231022
} else if (lhs_field == nullptr && IsAny(lhs)) {
@@ -1026,7 +1025,7 @@ class MessageEqualsState final {
10261025
well_known_types::UnpackAnyIfResolveable(
10271026
&arena_, lhs_reflection_.any_reflection, lhs, pool_, factory_));
10281027
if (lhs_unpacked) {
1029-
lhs_ptr = cel::to_address(lhs_unpacked);
1028+
lhs_ptr = lhs_unpacked.get();
10301029
}
10311030
}
10321031
if (rhs_field != nullptr && IsAnyField(rhs_field)) {
@@ -1036,7 +1035,7 @@ class MessageEqualsState final {
10361035
rhs.GetReflection()->GetMessage(rhs, rhs_field),
10371036
pool_, factory_));
10381037
if (rhs_unpacked) {
1039-
rhs_ptr = cel::to_address(rhs_unpacked);
1038+
rhs_ptr = rhs_unpacked.get();
10401039
rhs_field = nullptr;
10411040
}
10421041
} else if (rhs_field == nullptr && IsAny(rhs)) {
@@ -1045,7 +1044,7 @@ class MessageEqualsState final {
10451044
well_known_types::UnpackAnyIfResolveable(
10461045
&arena_, rhs_reflection_.any_reflection, rhs, pool_, factory_));
10471046
if (rhs_unpacked) {
1048-
rhs_ptr = cel::to_address(rhs_unpacked);
1047+
rhs_ptr = rhs_unpacked.get();
10491048
}
10501049
}
10511050
EquatableValue lhs_value;
@@ -1125,8 +1124,8 @@ class MessageEqualsState final {
11251124
const Message* absl_nonnull rhs_message =
11261125
rhs_field != nullptr
11271126
? &rhs.GetReflection()->GetMessage(rhs, rhs_field)
1128-
: rhs_unpacked != nullptr ? cel::to_address(rhs_unpacked)
1129-
: &rhs;
1127+
: rhs_unpacked.get() != nullptr ? rhs_unpacked.get()
1128+
: &rhs;
11301129
const auto* rhs_descriptor = rhs_message->GetDescriptor();
11311130
const auto rhs_well_known_type = rhs_descriptor->well_known_type();
11321131
switch (rhs_well_known_type) {
@@ -1206,8 +1205,8 @@ class MessageEqualsState final {
12061205
const Message* absl_nonnull lhs_message =
12071206
lhs_field != nullptr
12081207
? &lhs.GetReflection()->GetMessage(lhs, lhs_field)
1209-
: lhs_unpacked != nullptr ? cel::to_address(lhs_unpacked)
1210-
: &lhs;
1208+
: lhs_unpacked.get() != nullptr ? lhs_unpacked.get()
1209+
: &lhs;
12111210
const auto* lhs_descriptor = lhs_message->GetDescriptor();
12121211
const auto lhs_well_known_type = lhs_descriptor->well_known_type();
12131212
switch (lhs_well_known_type) {
@@ -1294,8 +1293,8 @@ class MessageEqualsState final {
12941293
const Message* absl_nonnull rhs_message =
12951294
rhs_field != nullptr
12961295
? &rhs.GetReflection()->GetMessage(rhs, rhs_field)
1297-
: rhs_unpacked != nullptr ? cel::to_address(rhs_unpacked)
1298-
: &rhs;
1296+
: rhs_unpacked.get() != nullptr ? rhs_unpacked.get()
1297+
: &rhs;
12991298
const auto* rhs_descriptor = rhs_message->GetDescriptor();
13001299
const auto rhs_well_known_type = rhs_descriptor->well_known_type();
13011300
switch (rhs_well_known_type) {
@@ -1374,8 +1373,8 @@ class MessageEqualsState final {
13741373
const Message* absl_nonnull lhs_message =
13751374
lhs_field != nullptr
13761375
? &lhs.GetReflection()->GetMessage(lhs, lhs_field)
1377-
: lhs_unpacked != nullptr ? cel::to_address(lhs_unpacked)
1378-
: &lhs;
1376+
: lhs_unpacked.get() != nullptr ? lhs_unpacked.get()
1377+
: &lhs;
13791378
const auto* lhs_descriptor = lhs_message->GetDescriptor();
13801379
const auto lhs_well_known_type = lhs_descriptor->well_known_type();
13811380
switch (lhs_well_known_type) {

0 commit comments

Comments
 (0)