소스 검색

Resolved an issue where NO_DESTROY and CONSTINIT were in incorrect order

Yuhanun Citgez 4 년 전
부모
커밋
eef276412e
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/google/protobuf/compiler/cpp/cpp_file.cc

+ 1 - 1
src/google/protobuf/compiler/cpp/cpp_file.cc

@@ -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_));