title: Unable to declare a template variable without defining it
body: <p>I am wanting to forward declare variable templates in a header file, and then have the actual instantiations in a separate compilation unit.</p>
  
  <p>I was led to believe that C++14 variable templates operated very much like static class variables do.  This is unfortunately seeming not to be quite the case, and it is preventing me from forward declaring my variable templates.</p>
  
  <pre><code>template &lt;typename T&gt; struct Variable {
      static int variable;
  };
  
  template &lt;typename T&gt; 
  extern int variable;
  
  int main() {
      (void) Variable&lt;char&gt;::variable;
      // (void) variable&lt;char&gt;;                   // &lt;-- line 10
  }
  
  template &lt;&gt; int Variable&lt;char&gt;::variable = 42;
  template &lt;&gt; int variable&lt;char&gt; = 23;
  </code></pre>
  
  <p>The code sample above compiles and runs as-is under GCC.  But uncommenting line 10 gives a compile-time error:</p>
  
  <pre class="lang-none prettyprint-override"><code>specialization of 'variable&lt;char&gt;' after instantiation
      template &lt;&gt; int variable&lt;char&gt; = 23;
                       ^
  </code></pre>