title: Strict aliasing rules broken with templates and inheritance
body: <p>The following code gives me warning in gcc that I break strict aliasing rules:</p>
  
  <pre><code>struct Base {
    int field = 2;
  };
  
  template &lt;typename T&gt;
  struct Specialization: public Base {
    void method() {
        Specialization copy;
        field = copy.field;
    }
  };
  
  int main() {
      Specialization&lt;int&gt; s;
      s.method();
  }
  </code></pre>
  
  <blockquote>
    <p>warning: dereferencing type-punned pointer will >break strict-aliasing rules [-Wstrict-aliasing]
           field = copy.field;</p>
  </blockquote>
  
  <p>When I remove the template, is seems to compile just fine.</p>
  
  <pre><code>struct Base {
    int field = 2;
  };
  
  struct Specialization: public Base {
    void method() {
        Specialization copy;
        field = copy.field;
    }
  };
  
  int main(){
      Specialization s;
      s.method();
  }
  </code></pre>
  
  <p>Am I really breaking strict aliasing rules or is it GCC producing a false positive?</p>
  
  <p>I'm using <code>-Wstrict-aliasing=3 -O3</code> on GCC8</p>