<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 --- - Wrong number of template arguments with empty parameter pack" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D24098&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=sWoJJzp3fAWyYsc-enQ1HZIy5WzU6UFVvO6vNp44ie4&s=Ghoqix69axS86t_1bNxuF8uuKGJvT9UFti7A005STWE&e=">24098</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Wrong number of template arguments with empty parameter pack
          </td>
        </tr>

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

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

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

        <tr>
          <th>OS</th>
          <td>All
          </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>ldionne.2@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>The following code fails to compile on Clang trunk:

    template <typename> struct f;

    template <typename ...Dummy, typename = f<int, Dummy...>>
    void foo() { }

The error is:

    prog.cc:3:53: error: wrong number of template arguments (2, should be 1)
     template <typename ...Dummy, typename = f<int, Dummy...>>
                                                         ^
    prog.cc:1:28: note: provided for 'template<class> struct f'
     template <typename> struct f;
                                ^

Strangely, the following compiles (swapped `Dummy...` and `int`):

    template <typename> struct f;

    template <typename ...Dummy, typename = f<Dummy..., int>>
    void foo() { }    


Live example: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__melpon.org_wandbox_permlink_yrtJAhiue1iDVLR3&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=sWoJJzp3fAWyYsc-enQ1HZIy5WzU6UFVvO6vNp44ie4&s=FUO5KJabGoujJ5Q7KLOezquN-7FnX5TkzcFzaEyXuRc&e=">http://melpon.org/wandbox/permlink/yrtJAhiue1iDVLR3</a>


Note that GCC rejects both examples. Naively, I think both should compile, 
but I haven't checked the standard. In all cases, either Clang has a bug,
GCC has a bug or both have a bug.</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>