title: Invalid explicitly-specified argument for template parameter which is constexpr
body: <p>I have a <code>static_loop</code> construct like this</p>
  
  <pre><code>template &lt;std::size_t n, typename F&gt; void static_loop(F&amp;&amp; f) {
      static_assert(n &lt;= 8 &amp;&amp; "static loop size should &lt;= 8");
      if constexpr (n &gt;= 8)
          f(std::integral_constant&lt;size_t, n - 8&gt;());
      if constexpr (n &gt;= 7)
          f(std::integral_constant&lt;size_t, n - 7&gt;());
      if constexpr (n &gt;= 6)
          f(std::integral_constant&lt;size_t, n - 6&gt;());
      if constexpr (n &gt;= 5)
          f(std::integral_constant&lt;size_t, n - 5&gt;());
      if constexpr (n &gt;= 4)
          f(std::integral_constant&lt;size_t, n - 4&gt;());
      if constexpr (n &gt;= 3)
          f(std::integral_constant&lt;size_t, n - 3&gt;());
      if constexpr (n &gt;= 2)
          f(std::integral_constant&lt;size_t, n - 2&gt;());
      if constexpr (n &gt;= 1)
          f(std::integral_constant&lt;size_t, n - 1&gt;());
  }
  
  
  template &lt;typename T&gt; constexpr size_t tupleSize(T) { return tuple_size_v&lt;T&gt;; }
  struct A {
      int a;
      int b;
      void run() {
          auto ab = std::make_tuple(std::ref(a), std::ref(b));
          static_loop&lt;tupleSize(ab)&gt;([&amp;](auto i) { std::get&lt;i&gt;(ab) = i; });
          std::cout &lt;&lt; a &lt;&lt; " " &lt;&lt; b &lt;&lt; std::endl;
      }
  };
  </code></pre>
  
  <p>However, it fails to iterate over a tuple as listed above.</p>
  
  <p><a href="https://godbolt.org/z/OE61J-" rel="nofollow noreferrer">live godbolt example</a></p>