<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 --- - Erroneous "too many template arguments for class template" (via template template)?"
   href="http://llvm.org/bugs/show_bug.cgi?id=20698">20698</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Erroneous "too many template arguments for class template" (via template template)?
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.4
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>zerolo@gmail.com
          </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>Created <span class=""><a href="attachment.cgi?id=12914" name="attach_12914" title="Repo failing using -std=c++11">attachment 12914</a> <a href="attachment.cgi?id=12914&action=edit" title="Repo failing using -std=c++11">[details]</a></span>
Repo failing using -std=c++11

Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix

The attached repo (which compiles fine with g++ 4.8.1) should be valid IMO, but
instead clang complains about 
<span class="quote">> clang++ --std=c++11 clang_repo.cpp </span >
clang_repo.cpp:21:6: error: no matching member function for call to 'Get'
  t2.Get<1>(); // not ok
  ~~~^~~~~~
clang_repo.cpp:7:18: note: candidate template ignored: substitution failure
[with Is = <1>]: too many template arguments for class template 'Foo'
  Inner<Is ...> &Get()
  ~~~~~          ^
1 error generated.

but the number of template arguments seem to be correct (i.e. one).

I've reduced this down from a case where the Inner-template was variadic, but
this doesn't seem to be the cause.
Making the Get-method non-variadic makes the error go away, but as the
Inner-template is supposed to be variadic, I can't really do that.

template<template<int> class Inner>
struct Test
{
  // works if Is is not variadic
  template<int ...Is>
  Inner<Is ...> &Get()
  {
    static Inner<Is ...> a;
    return a;
  }
};

template<int A>
struct Foo { };

int main (int argc, char const *argv[])
{
  Foo<1> f; // ok
  Test<Foo> t2; // ok
  t2.Get<1>(); // not ok
  return 0;
}</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>