title: keys in a std::set get changed on insert
body: <p>I currently have a very weird issue where the following code misbehaves:</p>
  
  <pre><code>std::set&lt;int&gt; simpleSet;
  for( int i=0; i&lt;10; ++i )
      simpleSet.insert( i );
  </code></pre>
  
  <p>Yes, it's really just inserting (or emplacing, same result) something into a set. Anyway, up to i=6 everything is fine but upon inserting 7 the set goes from</p>
  
  <pre><code>Locals
      i   7   int
      simpleSet   &lt;7 items&gt;   std::set&lt;int, std::less&lt;int&gt;, std::allocator&lt;int&gt; &gt;
          [0] 0   int
          [1] 1   int
          [2] 2   int
          [3] 3   int
          [4] 4   int
          [5] 5   int
          [6] 6   int
  </code></pre>
  
  <p>to</p>
  
  <pre><code>Locals
      i   8   int
      simpleSet   &lt;8 items&gt;   std::set&lt;int, std::less&lt;int&gt;, std::allocator&lt;int&gt; &gt;
          [0] 0   int
          [1] 1   int
          [2] 2   int
          [3] 1   int
          [4] 2   int
          [5] 1   int
          [6] 2   int
          [7] 1   int
  </code></pre>
  
  <p>in the debugger. This is reproducable with other datatypes and random values. Always on inserting the 8th element all previous elements are changed. Inserting more just adds more 1s and 2s to the set for some reason, and in new buckets.</p>
  
  <p>I'm working on Linux with glibc version 2.26 and gcc 7.2.0 or clang 4.0.1 (both produce the same problem).</p>
  
  <p><strong>Edit:</strong> This is issue with the debug data visualizer in QtCreator (and maybe other IDEs). When writing the contents of the set to stdout it prints the correct values.</p>