Skip to content

cannot compile c++ generated code #8484

Closed
@Eddie-cz

Description

@Eddie-cz

Version: 3.15.8
Language: C++
Windows 10, MSVC 16.9.3 with clang-cl compiler (LLVM 11.1)

Message definition:
syntax = "proto3";
message StringMsg
{
string value = 1;
}

Compilation of generated pb.cc fails for this message with "error : variable does not have a constant initializer".
Compiles with repeated modifier.

Variable is:
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT StringMsgDefaultTypeInternal StringMsg_default_instance;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions