title: How to deal with "exit-time destructor" warning in clang?
body: <p>In my C++11 code I get the clang warning "Declaration requires an exit-time destructor" in the following case:</p>
  
  <pre><code>static const std::map&lt;int, const someStruct&gt; mymap = {
      {1, {
          "A",
          "B",
          "C"
      }},
      {2, {
          "D",
          "E",
          "F"
      }}
  };
  </code></pre>
  
  <p>As far as I understand Google an "exit-time destructor" is required to destroy main() and statics in a deterministic way to prevent crashes on exit due to "already released variables". Is that right? Can someone explain it better?</p>
  
  <p>Plus: What can I do about it (I don't want to disable the warning)? The code above is used within context of one thread only.</p>
  
  <p>Looks like this is the way Chromium deals with these cases; would that be the right way for my case as well?</p>
  
  <pre><code>#define CR_DEFINE_STATIC_LOCAL(type, name, arguments) \
    static type&amp; name = *new type arguments
  </code></pre>
  
  <p>(Source: <a href="https://chromium.googlesource.com/chromium/src/+/32352ad08ee673a4d43e8593ce988b224f6482d3/base/basictypes.h" rel="noreferrer">https://chromium.googlesource.com/chromium/src/+/32352ad08ee673a4d43e8593ce988b224f6482d3/base/basictypes.h</a>)</p>