Skip to content

Commit

Permalink
Breaking Change: Remove deprecated Arena::CreateMessage.
Browse files Browse the repository at this point in the history
These have been marked ABSL_DEPRECATED as of v5.27.x and is replaced with Arena::Create which has been available since v3.0.0.

See https://engdoc.corp.google.com/eng/doc/devguide/proto/news/2024-10-02.md#arenacreatemessage

PiperOrigin-RevId: 689557672
  • Loading branch information
zhangskz authored and copybara-github committed Oct 24, 2024
1 parent 7ef7eeb commit d83a536
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
13 changes: 0 additions & 13 deletions src/google/protobuf/arena.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,19 +197,6 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final {

inline ~Arena() = default;

#ifndef PROTOBUF_FUTURE_REMOVE_CREATEMESSAGE
// Deprecated. Use Create<T> instead.
template <typename T, typename... Args>
ABSL_DEPRECATED("Use Create")
static T* CreateMessage(Arena* arena, Args&&... args) {
using Type = std::remove_const_t<T>;
static_assert(
is_arena_constructable<Type>::value,
"CreateMessage can only construct types that are ArenaConstructable");
return Create<Type>(arena, std::forward<Args>(args)...);
}
#endif // !PROTOBUF_FUTURE_REMOVE_CREATEMESSAGE

// Allocates an object type T if the arena passed in is not nullptr;
// otherwise, returns a heap-allocated object.
template <typename T, typename... Args>
Expand Down
4 changes: 0 additions & 4 deletions src/google/protobuf/port_def.inc
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,6 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
// Owner: shaod@, gberg@
#define PROTOBUF_FUTURE_DESCRIPTOR_EXTENSION_DECL 1

// Removes Arena::CreateMessage, as Arena::Create is equivalent
// Owner: ckennelly@, mkruskal@
#define PROTOBUF_FUTURE_REMOVE_CREATEMESSAGE 1

// Renames DescriptorPool::AddUnusedImportTrackFile
// Owner: mkruskal@
#define PROTOBUF_FUTURE_RENAME_ADD_UNUSED_IMPORT 1
Expand Down

0 comments on commit d83a536

Please sign in to comment.