title: C++ Protocol Buffer: Temporary of non-literal type 'google::protobuf::internal::CallOnInitializedMutex <std::mutex>' in a constant expression
body: <p>I'm using the protoc-3.18.0-win32 version from <a href="https://github.com/protocolbuffers/protobuf/releases/tag/v3.18.0" rel="nofollow noreferrer">here</a>. After successfully compiling the <code>.proto</code> files, I get the following error in my QtCreator 5 (C++11) program:</p>
  <pre><code>C:\Users\MyName\MyProject\lib\include\google\protobuf\stubs\mutex.h:124: error: temporary of non-literal type 'google::protobuf::internal::CallOnceInitializedMutex&lt;std::mutex&gt;' in a constant expression
  In file included from lib\include/google/protobuf/descriptor.h:66:0,
                   from lib\include/google/protobuf/message.h:121,
                   from lib\include/google/protobuf/generated_message_bases.h:42,
                   from src/protodata/myfile.pb.h:26,
                   from src/myfile/myfile.h:12,
                   from src\myclass/myclass.h:8,
                   from src\mywidget.cpp:2:
  lib\include/google/protobuf/stubs/mutex.h: In constructor 'constexpr google::protobuf::internal::WrappedMutex::WrappedMutex()':
  lib\include/google/protobuf/stubs/mutex.h:124:29: error: temporary of non-literal type 'google::protobuf::internal::CallOnceInitializedMutex&lt;std::mutex&gt;' in a constant expression
     constexpr WrappedMutex() {}
                               ^
  lib\include/google/protobuf/stubs/mutex.h:98:7: note: 'google::protobuf::internal::CallOnceInitializedMutex&lt;std::mutex&gt;' is not literal because:
   class CallOnceInitializedMutex {
         ^~~~~~~~~~~~~~~~~~~~~~~~
  lib\include/google/protobuf/stubs/mutex.h:98:7: note:   'google::protobuf::internal::CallOnceInitializedMutex&lt;std::mutex&gt;' has a non-trivial destructor
  </code></pre>
  <p>where the erroneous lines of code are:</p>
  <pre><code>// Mutex is a natural type to wrap. As both google and other organization have
  // specialized mutexes. gRPC also provides an injection mechanism for custom
  // mutexes.
  class GOOGLE_PROTOBUF_CAPABILITY(&quot;mutex&quot;) PROTOBUF_EXPORT WrappedMutex {
   public:
  #if defined(__QNX__)
    constexpr WrappedMutex() = default;
  #else
    constexpr WrappedMutex() {} // &lt;--- Error points here
  #endif
  </code></pre>