[LLVMbugs] [Bug 21446] New: Trailing decltype in variadic function with explicitly specified template parameters fails

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Nov 1 19:54:42 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=21446

            Bug ID: 21446
           Summary: Trailing decltype in variadic function with explicitly
                    specified template parameters fails
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: eniebler at boost.org
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

This code fails to compile:

    template<typename...Us>
    void boinc(Us...us)
    {}

    template<typename ... Us>
    auto foo(Us...us) -> decltype(boinc(((Us)us)...))
    {
    }

    int main()
    {
        foo<int, int, int>(0,0,0);
    }

The error I get is:

test.cpp:13:5: error: no matching function for call to 'foo'
    foo<int, int, int>(0,0,0);
    ^~~~~~~~~~~~~~~~~~
test.cpp:7:6: note: candidate template ignored: substitution failure
      [with Us = <int, int, int>]: pack expansion contains parameter packs 'Us'
and 'us' that have different lengths (3 vs. 4)
auto foo(Us...us) -> decltype(boinc(((Us)us)...))
     ^                                      ~~~
1 error generated.


This is obviously bogus.

-- 
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/20141102/488bf9fe/attachment.html>


More information about the llvm-bugs mailing list