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

            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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

For the following code:

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

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

    int main()
    {
        C<int, double> c;
        foo(c);
    }

clang 3.5 gives the following error:

    test.cpp:10:5: error: no matching function for call to 'foo'
        foo(c);
        ^~~
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to