Compilation error on new message via arena fails

16 views
Skip to first unread message

Atılhan Emre Dursunoğlu

unread,
Mar 13, 2020, 10:50:59 AM3/13/20
to Protocol Buffers
**What version of protobuf and what language are you using?**
Version: v3.11.4
Language: C++

**What operating system (Linux, Windows, ...) and version?**
Linux 5.4.23-1-MANJARO
**What runtime / compiler are you using (e.g., python version or gcc version)**
both gcc 9.2.1 and clang 9.0.1

When I try to create new message via arena functions, compilation fails. If I use google::protobuf::Arena::CreateArray it fails because of static_assertion (error: static assertion failed: CreateArray requires a trivially destructible type). For google::protobuf::Arena::CreateMessage, I get "error: no matching function for call to ‘foo::Foo::Foo(std::nullptr_t, int)’".

Here is a mock project.

Thanks.

Atılhan Emre Dursunoğlu

unread,
Mar 13, 2020, 11:54:23 AM3/13/20
to Protocol Buffers
The main reason google::protobuf::Arena::CreateMessage failed at compilation was because i was using parameters wrong. Can i create message array using CreateArray? If not then can i create message array using arena?
Reply all
Reply to author
Forward
0 new messages