[LLVMbugs] [Bug 21536] New: clang incorrectly deduces template parameter pack

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Nov 11 14:18:14 PST 2014


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

            Bug ID: 21536
           Summary: clang incorrectly deduces template parameter pack
           Product: clang
           Version: 3.5
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hui.li at me.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Clang 3.5 is unable to compile the following code:

template < typename, typename... >
struct X {};

template < typename... T >
void foo(const X<T...>&)
{}

int main()
{
   X<int,int> x;
   foo(x);
}


The error I got reads:

t.cpp:11:4: error: no matching function for call to 'foo'
   foo(x);
   ^~~
t.cpp:5:6: note: candidate template ignored: substitution failure [with T =
<>]: too few template arguments for class template 'X'
void foo(const X<T...>&)
     ^         ~
1 error generated.


GCC 4.8.3 is able to compile this code.

-- 
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/20141111/1ec8f6a0/attachment.html>


More information about the llvm-bugs mailing list