title: Stringstream not working with doubles when _GLIBCXX_DEBUG enabled
body: <p>I'm using _GLIBCXX_DEBUG mode to help find errors in my code but I'm having a problem which I think is an error in the library, but hopefully someone can tell me I'm just doing something wrong.  Here is a short example which repro's the problem:</p>
  
  <pre><code>#define _GLIBCXX_DEBUG
  #include &lt;iostream&gt;
  #include &lt;sstream&gt;
  
  int main (int argc, const char * argv[]) {
      std::ostringstream ostr;
      ostr &lt;&lt; 1.2;
      std::cout &lt;&lt; "Result: " &lt;&lt; ostr.str() &lt;&lt; std::endl;
      return 0;
  }
  </code></pre>
  
  <p>If I comment out the #define then the output is (as expected):</p>
  
  <pre><code>Result: 1.2
  </code></pre>
  
  <p>With the _GLIBCXX_DEBUG define in place however the output is simply:</p>
  
  <pre><code>Result:
  </code></pre>
  
  <p>I've tracked this down to the _M_num_put field of the stream being left as NULL, which causes an exception to be thrown (and caught) in the stream and results in no output for the number.  _M_num_put is supposed to be a std::num_put from the locale (I don't claim to understand how that's supposed to work, it's just what I've learned in my searching so far).</p>
  
  <p>I'm running this on a Mac with XCode and have tried it with both "LLVM GCC 4.2" and "Apple LLVM Compiler 3.0" as the compiler with the same results.</p>
  
  <p>I'd appreciate any help in solving this.  I want to continue to run with _GLIBCXX_DEBUG mode on my code but this is interfering with that.</p>