title: Template template parameter and default values
body: <p>Consider the following code:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>template&lt;typename T&gt;
  struct A { };
  
  // same as A, but with one extra defaulted parameter
  template&lt;typename T, typename F = int&gt;
  struct B { };
  
  template&lt;template&lt;typename&gt; typename T&gt;
  T&lt;int&gt; build() { return {}; }
  
  int main()
  {
      build&lt;A&gt;();  // works in gcc and clang
      build&lt;B&gt;();  // works in gcc, does not work in clang
  }
  </code></pre>
  
  <p>g++ (7.3.0) compiles the code just fine, however, clang++ (5.0.1) emits the following:</p>
  
  <pre><code>example.cpp:14:5: error: no matching function for call to 'build'
      build&lt;B&gt;();  // works in gcc, does not work in clang
      ^~~~~~~~
  example.cpp:9:8: note: candidate template ignored: invalid
        explicitly-specified argument for template parameter 'T'
  T&lt;int&gt; build() { return {}; }
  </code></pre>
  
  <p>Which of the compilers is right?</p>
  
  <hr>
  
  <p><strong>Note:</strong>
  The important line is obviously:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>template&lt;template&lt;typename&gt; typename T&gt;
  </code></pre>
  
  <p>Because both compilers are satisfied with:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>template&lt;template&lt;typename...&gt; typename T&gt;
  </code></pre>
  
  <p>So the question is whether default values should be considered when passing template template arguments.</p>