<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 --- - erroneous substitution failure through a type alias on variadic template"
   href="https://llvm.org/bugs/show_bug.cgi?id=26047">26047</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>erroneous substitution failure through a type alias on variadic template
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.6
          </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>eric.s.wallace@intel.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>Created <span class=""><a href="attachment.cgi?id=15571" name="attach_15571" title="The test case from the description, but pre-processed">attachment 15571</a> <a href="attachment.cgi?id=15571&action=edit" title="The test case from the description, but pre-processed">[details]</a></span>
The test case from the description, but pre-processed

The following code seems to produce an erroneous substitution failure:

====

template <typename... Ts>
struct function
{
};

template <typename... Ts>
using Callback = function<void(Ts...)>;

template <typename... Ts>
void foo(Callback<Ts...> callback)
{
}

void foo_int(Callback<int> callback)
{
}

template <typename... Ts>
void foo_no_type_indirection(function<void(Ts...)> callback)
{
}

int main()
{
    Callback<int> callback = function<void(int)>{};
    foo_int(callback); // succeeds
    foo_no_type_indirection(callback); // succeeds
    foo(callback); // fails: substitution failure
    return 0;
}

====

Note that if the substitution is done by hand (the "foo_int" case), the call
succeeds. Also if we don't go through the "Callback" type alias (the
"foo_no_type_indirection" case), the call succeeds. Variadic templates are also
required here; when I tested using a single argument template, clang succeeded.

This test case compiles with gcc4.8.

There are a few other substitution failures kicking around in the bug list, but
none looked quite like this. I thought this test case might be useful even if
it turns out to be a duplicate problem.</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>