title: Compiler segfault during explicit template instantiation on clang 11
body: <p>The following explicit template instantiation results in compiler frontend segfault under LLVM <code>clang++ 11.0</code> on <code>x86_64-pc-windows-msvc</code>, using the <code>clang-cl</code> interface with <code>-std=c++17</code>, regardless of optimization level.</p>
  <p><code>A.h</code></p>
  <pre><code>template &lt;typename T&gt;
  class A
  {
  public:
  
      T value;
  
      static constexpr auto address = &amp;A&lt;T&gt;::value;
  };
  
  extern template class A&lt;float&gt;;
  </code></pre>
  <p><code>A.cpp</code></p>
  <pre><code>#include &quot;A.h&quot;
  
  template class A&lt;float&gt;;
  </code></pre>
  <p>Note that since C++17 <code>A::address</code> is an <em>inline variable</em> so ODR-using cannot be a problem here.</p>
  <p>The compiler behavior is obviously wrong, I already filed a report at the LLVM bug tracker.
  Nevertheless, I am still curious about the actual correctness of the code.</p>
  <p>Is it an undefined behavior which is handled incorrectly by the compiler, or the code itself is free of any problems and it's only about the compiler. Personally I don't find anything in the standard at the specification of explicit template instantiations which would suggest that the above code is wrong.</p>
  <p><strong>I don't think that the above is <em>ill-formed</em>, am I missing something?</strong></p>