title: Non-type (reference) template parameters and linkage
body: <p>In the following,</p>
  
  <pre><code>int i{3};
  const int j{3};
  extern const int k{3};
  
  template &lt;typename T, T&amp;&gt;
  void f() {}
  
  int main()
  {
      f&lt;int, i&gt;();        // OK
      f&lt;int const, j&gt;();  // not valid template argument: 'j' has not external linkage
      f&lt;int const, k&gt;();  // OK
  }
  </code></pre>
  
  <p>GCC gives error for the use of <code>j</code> as template parameter, while clang compiles fine.</p>
  
  <ul>
  <li>what is the linkage of <code>i</code>, <code>j</code>?</li>
  <li>why is there a difference between <code>const</code>/non-<code>const</code>?</li>
  <li>who is correct? GCC or clang?</li>
  </ul>