diff --git a/third_party/protobuf/README.chromium b/third_party/protobuf/README.chromium index f2e57bd3848d..ad655678a3d8 100644 --- a/third_party/protobuf/README.chromium +++ b/third_party/protobuf/README.chromium @@ -44,3 +44,5 @@ A BUILD.gn file has been added for building with GN. Cherry-pick pherl changes to make protobuf build on VS2015. Cherry-pick c3cb53b (fix "sometimes-uninitialized" warning). + +Cherry-pick https://github.com/google/protobuf/pull/621 diff --git a/third_party/protobuf/src/google/protobuf/stubs/common.h b/third_party/protobuf/src/google/protobuf/stubs/common.h index e9d0e3525569..bdb6b5221384 100644 --- a/third_party/protobuf/src/google/protobuf/stubs/common.h +++ b/third_party/protobuf/src/google/protobuf/stubs/common.h @@ -392,11 +392,12 @@ struct CompileAssert { } // namespace internal #undef GOOGLE_COMPILE_ASSERT +#if __cplusplus >= 201103L +#define GOOGLE_COMPILE_ASSERT(expr, msg) static_assert(expr, #msg) +#else #define GOOGLE_COMPILE_ASSERT(expr, msg) \ typedef ::google::protobuf::internal::CompileAssert<(bool(expr))> \ msg[bool(expr) ? 1 : -1] - - // Implementation details of COMPILE_ASSERT: // // - COMPILE_ASSERT works by defining an array type that has -1 @@ -437,6 +438,7 @@ struct CompileAssert { // // This is to avoid running into a bug in MS VC 7.1, which // causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1. +#endif // __cplusplus >= 201103L // =================================================================== // from google3/base/memory/scoped_ptr.h