title: auto template parameters: g++ 7.3 vs clang++ 6.0 : Which compiler is correct?
body: <p>Two compilers produce different results for this code example.
  Clang generates two different types. G++ uses same type for <code>fu</code> and <code>fi</code>.
  Which one is standard compliant? </p>
  
  <pre><code>#include &lt;iostream&gt;
  
  template&lt; auto IVAL&gt;
  struct foo {
      decltype(IVAL) x = -IVAL;
  };
  
  int main()
  {
      foo&lt;10u&gt; fu;
      foo&lt;10&gt; fi;
      std::cout &lt;&lt; fi.x &lt;&lt; " " &lt;&lt; fu.x &lt;&lt; '\n';
      return 0;
  }
  </code></pre>
  
  <p>g++-7.3 output:</p>
  
  <blockquote>
    <p>4294967286 4294967286</p>
  </blockquote>
  
  <p>clang-6.0 output:</p>
  
  <blockquote>
    <p>-10 4294967286</p>
  </blockquote>