title: C++ ODR Warning with lto enabled using nested structs
body: <p>After enabling lto in one of my projects the compiler started to throw warnings for lto violations at me.
  After a bit of testing it boils down to this construct.</p>
  
  <pre><code>typedef struct {
      typedef struct {
      } test_t;
      std::vector&lt;test_t&gt; t;
  } test2_t;
  </code></pre>
  
  <p>Once I change it to </p>
  
  <pre><code>struct test2_t {
      typedef struct {
      } test_t;
      std::vector&lt;test_t&gt; t;
  };
  </code></pre>
  
  <p>or</p>
  
  <pre><code>typedef struct {
      typedef struct {
      } test_t;
      test_t t;
  } test2_t;
  </code></pre>
  
  <p>the warning goes away but I don't really understand why. My guess is that it treats the anonymous struct as different types in different files, but I would not expect a warning since it is a common use case. Note that it does not make a difference if I change the inner typedef but leave the outer on in place. It also does not matter whether test_t contains members or not.</p>
  
  <ul>
  <li>What's the reason for this warning?</li>
  <li>Is this behaviour expected?</li>
  <li>Might this be an STL error, since it works fine without vector?</li>
  </ul>