title: Linker errors with constexpr arrays
body: <p>I have been writing code that uses <code>constexpr float[n]</code> to hold coefficients of a polynomial fit. The code boils down to the following snippet:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  template&lt;typename Real, size_t degree&gt; struct Data;
  
  template&lt;typename Real&gt; struct Data&lt;Real, 3&gt; {
      constexpr static Real coefficients[4] = {-0.18374177,
                                               1.87998084,
                                               -0.86969933,
                                               0.09227796};
  };
  
  int main() {
      std::cout &lt;&lt; Data&lt;float, 3&gt;::coefficients[0] &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>This compiles fine using g++ (version 5.4.0 and 7.1.0). But causes linker errors on icc (version 18.0.2) and clang++ (version 3.8.0 and version 4.0.1). From <a href="https://stackoverflow.com/questions/23404713/are-constexpr-array-members-compile-time-constants">this</a> question, I understand that using <code>constexpr</code> on arrays is legal C++ but it also mentions the linker error with clang++. If I remove the template, the code compiles on icc but still gives a linker error with clang++.</p>
  
  <p>So my question is whether this is in fact legal C++(11) or not? If this is legal C++, why is it still not supported by the two other compilers? If it isn't, what makes it illegal?</p>
  
  <p>Any input is greatly appreciated.</p>