Skip to content

Commit

Permalink
Resolved an issue where NO_DESTROY and CONSTINIT were in incorrect order
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuhanun authored and acozzette committed Feb 17, 2021
1 parent 0040102 commit eef2764
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/google/protobuf/compiler/cpp/cpp_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ void FileGenerator::GenerateSourceDefaultInstance(int idx,
// enough. However, the empty destructor fails to be elided in some
// configurations (like non-opt or with certain sanitizers). NO_DESTROY is
// there just to improve performance and binary size in these builds.
format("PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_NO_DESTROY $1$ $2$;\n",
format("PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT $1$ $2$;\n",
DefaultInstanceType(generator->descriptor_, options_),
DefaultInstanceName(generator->descriptor_, options_));

Expand Down

0 comments on commit eef2764

Please sign in to comment.