Created attachment 15571
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.
bug.ii
(606 bytes, application/octet-stream)