[llvm-bugs] [Bug 26047] New: erroneous substitution failure through a type alias on variadic template

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jan 6 10:21:45 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26047

            Bug ID: 26047
           Summary: erroneous substitution failure through a type alias on
                    variadic template
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: eric.s.wallace at intel.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 15571
  --> https://llvm.org/bugs/attachment.cgi?id=15571&action=edit
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160106/2307729b/attachment.html>


More information about the llvm-bugs mailing list