[LLVMbugs] [Bug 22191] New: Unexpected error with variadic template function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jan 10 22:51:53 PST 2015


            Bug ID: 22191
           Summary: Unexpected error with variadic template function
           Product: clang
           Version: 3.5
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: zeratul976 at hotmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

For the following code:

    template <typename, typename...>
    class C {};

    template <typename... V>
    void foo(C<V...>);

    int main()
        C<int, double> c;

clang 3.5 gives the following error:

    test.cpp:10:5: error: no matching function for call to 'foo'
    test.cpp:5:6: note: candidate template ignored: substitution failure [with
V = <>]: too few template arguments for class template 'C'
    void foo(C<V...>);
         ^   ~

I believe this error is bogus. While it's true that instantiating with template
function with [V = <>] would produce an error, there is no reason to perform
that instantiation. The only instantiation that needs to be performed is [V =
<int, double>], and that doesn't produce an error.

GCC 4.9.2 compiles this code successfully.

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/20150111/a0d67af1/attachment.html>

More information about the llvm-bugs mailing list