From 064b50e8e9cd7a82acc2fcebfc252e8d58dede32 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Wed, 6 Nov 2024 15:50:40 -0800 Subject: [PATCH] Internal change PiperOrigin-RevId: 693891307 --- src/google/protobuf/compiler/cpp/test_bad_identifiers.proto | 5 +++-- src/google/protobuf/compiler/cpp/unittest.cc | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/google/protobuf/compiler/cpp/test_bad_identifiers.proto b/src/google/protobuf/compiler/cpp/test_bad_identifiers.proto index ebe87975c5..dbd4451c55 100644 --- a/src/google/protobuf/compiler/cpp/test_bad_identifiers.proto +++ b/src/google/protobuf/compiler/cpp/test_bad_identifiers.proto @@ -170,8 +170,9 @@ message TestConflictingSymbolNames { // For clashing local variables in Serialize and ByteSize calculation. optional string target = 38; - extensions 1000 to max - [verification = UNVERIFIED]; // NO_PROTO3 + // clang-format off + extensions 1000 to max [verification = UNVERIFIED]; // NO_PROTO3 + // clang-format on } // Special names as above, but at file scope. diff --git a/src/google/protobuf/compiler/cpp/unittest.cc b/src/google/protobuf/compiler/cpp/unittest.cc index 3f94360f5a..1d6e62f6fe 100644 --- a/src/google/protobuf/compiler/cpp/unittest.cc +++ b/src/google/protobuf/compiler/cpp/unittest.cc @@ -28,6 +28,7 @@ #include "google/protobuf/unittest_embed_optimize_for.pb.h" #include "google/protobuf/unittest_optimize_for.pb.h" + #define MESSAGE_TEST_NAME MessageTest #define GENERATED_DESCRIPTOR_TEST_NAME GeneratedDescriptorTest #define GENERATED_MESSAGE_TEST_NAME GeneratedMessageTest @@ -75,6 +76,7 @@ TEST(GENERATED_MESSAGE_TEST_NAME, TestConflictingSymbolNames) { EXPECT_EQ(123, message.GetExtension(ExtensionMessage::repeated_int32_ext, 0)); } + TEST(GENERATED_MESSAGE_TEST_NAME, TestSwapNameIsNotMangledForFields) { // For backwards compatibility we do not mangle `swap`. It works thanks to // overload resolution.