title: Extern template: declaration does not declare anything
body: <p>I have a template class</p>
  
  <p>expof.h:</p>
  
  <pre><code>template &lt;class T&gt;
  class ExpOf{
  ...
  }
  </code></pre>
  
  <p>which I repeatedly use throughout my code for e.g. <code>T = double</code> [and other classes that <code>ExpOf</code> should not know anything about].
  So I thought it would be a good idea to compile it once and for all [or twice...]</p>
  
  <p>expofdouble.cpp:</p>
  
  <pre><code>#include "expof.h"
  template class ExpOf&lt;double&gt;;
  </code></pre>
  
  <p>and declare it in a different header so it would not get compiled when expof.h is included.</p>
  
  <p>expofdouble.h:</p>
  
  <pre><code>extern template ExpOf&lt;double&gt;;
  </code></pre>
  
  <p>When I compile this (clang-800.0.42.1) I get (numerous) warnings</p>
  
  <pre><code>expofdouble.h: warning: declaration does not declare anything [-Wmissing-declarations]
  extern template ExpOf&lt;double&gt;;
                  ^~~~~~~~~~~~~
  </code></pre>
  
  <p>Am I getting the desired behavior? Why the warning then? Should I do this differently?</p>