title: Internal compiler error while working with variadic templates
body: <p>I am trying to get the product of all variadic template arguments given to a basic struct. At looks like follows:</p>
  
  <pre><code>template&lt;int a, int ... as&gt;
  struct A {
  
      int data[doIt&lt;a, as...&gt;()];
  };
  </code></pre>
  
  <p>And I constructed <code>doIt&lt;&gt;()</code> in multiple levels. I found out that this is the only way it should work. I got this solution from <a href="https://stackoverflow.com/questions/23443511/how-to-match-empty-arguments-pack-in-variadic-template">this stackoverflow question</a>. The code looks loke follows:</p>
  
  <pre><code>template&lt;int ... is&gt;
  constexpr std::size_t doIt();
  
  template&lt;int i, int ... is&gt;
  constexpr std::size_t doIt_helper() {
      return i * doIt&lt;is...&gt;(); // this row throws the error
  }
  
  template&lt;&gt;
  constexpr std::size_t doIt&lt;&gt;() {
      return 1;
  }
  
  template&lt;int ... is&gt;
  constexpr std::size_t doIt() {
      return doIt_helper&lt;is...&gt;();
  }
  </code></pre>
  
  <p>And when I try to compile the code I get: <code>internal compiler error: in instantiate_decl, at cp/pt.c:22741</code> and I am supposed to report the bug to gcc. But I want to make sure that I didn't do the mistake. I am compiling with <code>g++ -std=c++17</code>. And the version is <code>gcc version 7.5.0</code>. What's going on?</p>