title: msvc and gcc different behavior
body: <pre><code>#include &lt;iostream&gt;
  template&lt;typename T&gt;
  const T unit{ 1 };
  
  template&lt;typename T&gt;
  struct data
  {
      typename T::value_type val;
  };
  
  struct decimal_def
  {
      using  value_type = int;
      static const value_type unit_val() {
          return 10;
      }
  };
  
  template&lt;typename T&gt;
  const data&lt;T&gt; unit&lt;data&lt;T&gt;&gt; { T::unit_val() };
  
  auto decimal_data_unit = unit&lt;data&lt;decimal_def&gt;&gt;;
  
  int main(){
      std::cout &lt;&lt; decimal_data_unit.val &lt;&lt; std::endl;
      return 0;
  }
  </code></pre>
  <p>exoect: 10<br />
  gcc: 10<br />
  msvc: 0</p>
  <p>I think the reason of the difference between gcc and msvc is that compilers optimize <code>unit_val()</code> differently.</p>