title: MSVC: a variable with non-static storage duration cannot be used as a non-type argument
body: <p>Consider the following code inspired by <a href="https://www.youtube.com/watch?v=2l83JlqkzBk" rel="nofollow noreferrer">this talk</a>:</p>
  
  <pre><code>template&lt;typename, typename...&gt;
  struct even_common_type_helper_impl;
  
  template&lt;std::size_t... Is, typename... Ts&gt;
  struct even_common_type_helper_impl&lt;std::index_sequence&lt;Is...&gt;, Ts...&gt;
  {
      template&lt;std::size_t I&gt;
      using type_at = std::tuple_element_t&lt;I, std::tuple&lt;Ts...&gt;&gt;;
  
      using even_common_type = std::common_type_t&lt;type_at&lt;2 * Is&gt;...&gt;;
  };
  
  template&lt;typename... Ts&gt;
  using even_common_type_helper =
      even_common_type_helper_impl&lt;std::make_index_sequence&lt;sizeof...(Ts) / 2&gt;, Ts...&gt;;
  
  template&lt;typename... Ts&gt;
  using even_common_type = typename even_common_type_helper&lt;Ts...&gt;::even_common_type;
  </code></pre>
  
  <p>Basically, I am getting a template type parameter pack and trying to extract a common type of all types located on even positions in this pack.</p>
  
  <p>The code above works with <em>gcc 8.1</em> and <em>clang 6.0</em>, but fails with the latest <em>MSVC</em> version with the following error:</p>
  
  <blockquote>
    <p>error C2971: 'std::tuple_element_t': template parameter '_Index': 'I': a variable with non-static storage duration cannot be used as a non-type argument</p>
  </blockquote>
  
  <p>Do I miss any important details here or is it just another <em>MSVC</em> bug?</p>
  
  <p><a href="https://godbolt.org/g/E5vbiR" rel="nofollow noreferrer"><strong>Godbolt link</strong></a></p>