<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - defaulted class template parameters dropped when rededucing template template parameter"
   href="http://llvm.org/bugs/show_bug.cgi?id=22601">22601</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>defaulted class template parameters dropped when rededucing template template parameter
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++11
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>eniebler@boost.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following code compiles successfully with gcc and fails with clang. I
honestly don't know for certain who is right here, but I would really like gcc
to be right.

template<typename...> struct list;

template<template<typename...> class A>
struct wrap
{
  template<typename X, typename T = wrap>
  struct impl;
  template<typename...X, template<typename...> class D>
  struct impl<list<X...>, wrap<D>>
  {
    using type = D<X...>;
  };
  template<typename...T>
  using apply = typename impl<list<T...>>::type;
};

template<typename A, typename B> struct L;
template<typename A, typename B = void> struct L {};

int main()
{
  wrap<L>::apply<int> s;
}

The error clang gives is:

test.cpp:15:18: error: too few template arguments for class template 'L'
    using type = D<X...>;
                 ^
test.cpp:18:3: note: in instantiation of template class
      'wrap<L>::impl<list<int>, wrap<L> >' requested here
  using apply = typename impl<list<T...>>::type;
  ^
test.cpp:28:12: note: in instantiation of template type alias 'apply' requested
here
  wrap<L>::apply<int> s;
           ^
test.cpp:23:41: note: template is declared here
template<typename A, typename B> struct L;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~        ^
1 error generated.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>