<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 --- - clang++ reports substitution failure with incorrect argument list"
   href="http://llvm.org/bugs/show_bug.cgi?id=16646">16646</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang++ reports substitution failure with incorrect argument list
          </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>sandipan.mohanty@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 produces a "substitution failure" in clang++ trunk, although
it seems ok and works as expected in GCC.

---- begin example code ---
#include <iostream>
#include <tuple>

template <typename T> struct DefaultValue { const T value=0;};
template <> struct DefaultValue<std::string> { const std::string
value="Uninitialized";};

template <typename ... Args>
using Zero = std::tuple<DefaultValue<Args> ...>;

template <typename ... Args>
void f(const Zero<Args ...> &t)
{
    std::cout << sizeof...(Args) << std::endl;
}

int main()
{
    Zero<int,double,double> T;
    f(T);
    // f<int,double,double>(T); // This works
}
---- end example code ---
The compiler error is :

v1.cc:19:5: error: no matching function for call to 'blaha'
    blaha(T);
    ^~~~~
v1.cc:11:6: note: candidate template ignored: substitution failure [with Args =
<int>]
void f(const Zero<Args ...> &t)
     ^
1 error generated.


Note the "with Args =<int>" part. When I call f with T, Args should be inferred
as <int, double, double>. Shouldn't it ?</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>