title: Difference in stringstream behavior for void* type using libc++ and libstdc++
body: <p>The following test program returns different results depending on whether I'm using libc++ or libstdc++.</p>
  
  <pre><code>#include &lt;sstream&gt;
  #include &lt;iostream&gt;
  
  int main()
  {
      int a = 0;
      void* optr = &amp;a;
      void* iptr;
  
      std::stringstream ss;
      ss &lt;&lt; optr;
      std::cout &lt;&lt; ss.str() &lt;&lt; '\n';
  
      ss &gt;&gt; iptr;
      std::cout &lt;&lt; iptr &lt;&lt; '\n';
  
      return 0;
  }
  </code></pre>
  
  <p>I'm using the following version of clang from Xcode 5 on OSX 10.9.2</p>
  
  <pre><code>$ xcrun clang++ --version              
  Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
  Target: x86_64-apple-darwin13.1.0
  Thread model: posix
  </code></pre>
  
  <p>Here's the output of the test when built with libstdc++ and libc++</p>
  
  <pre><code>$ xcrun clang++ test.cpp  &lt;-- libstdc++ version             
  $ ./a.out
  0x7fff5ec723e8
  0x7fff5ec723e8
  $ xcrun clang++ test.cpp -stdlib=libc++  &lt;-- libc++ version
  $ ./a.out
  0x7fff5205125c
  0x7fff5
  </code></pre>
  
  <p>Is this a bug in the libc++ implementation of stringstream?  Is this usage of void* with stringstream valid C++?</p>
  
  <p>Thanks!</p>