Browse Source

stubs/mutex: Fix compilation by initializing variable in WrappedMutex class.

This solves the following error in gcc:
explicitly defaulted function cannot be declared 'constexpr' because the implicit declaration is not 'constexpr'
Biswapriyo Nath 4 years ago
parent
commit
5cc03457e6
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/google/protobuf/stubs/mutex.h

+ 3 - 3
src/google/protobuf/stubs/mutex.h

@@ -125,11 +125,11 @@ class GOOGLE_PROTOBUF_CAPABILITY("mutex") PROTOBUF_EXPORT WrappedMutex {
 
 
  private:
  private:
 #if defined(GOOGLE_PROTOBUF_SUPPORT_WINDOWS_XP)
 #if defined(GOOGLE_PROTOBUF_SUPPORT_WINDOWS_XP)
-  CallOnceInitializedMutex<CriticalSectionLock> mu_;
+  CallOnceInitializedMutex<CriticalSectionLock> mu_ {};
 #elif defined(_MSC_VER)
 #elif defined(_MSC_VER)
-  CallOnceInitializedMutex<std::mutex> mu_;
+  CallOnceInitializedMutex<std::mutex> mu_ {};
 #else
 #else
-  std::mutex mu_;
+  std::mutex mu_ {};
 #endif
 #endif
 };
 };