<html>
    <head>
      <base href="https://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 --- - Template argument deduction for base class fails"
   href="https://llvm.org/bugs/show_bug.cgi?id=27155">27155</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Template argument deduction for base class fails
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.8
          </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++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>roman.perepelitsa@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>struct B {};

  template <class T, int>
  struct D : T {};

  template <class T>
  void Foo(D<T, 0>);

  int main() {
    Foo(D<D<B, 0>, 1>());
  }

Clang erroneously rejects this code:

  10 : error: no matching function for call to 'Foo'
  Foo(D<D<B, 0>, 1>());
  ^~~
  7 : note: candidate template ignored: could not match 0 against 1
  void Foo(D<T, 0>);
  ^

However, it accepts this very similar code:

  template <class T, int>
  struct S {};

  template <class T>
  struct S<T, 1> : S<T, 0> {};

  template <class T>
  void Foo(S<T, 0>);

  int main() {
    Foo(S<void, 1>());
  }</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>