[LLVMbugs] [Bug 14841] New: substitution failure with explicitly-specified template arguments via parameter pack

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jan 7 19:10:58 PST 2013


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

             Bug #: 14841
           Summary: substitution failure with explicitly-specified
                    template arguments via parameter pack
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: richard-llvm at metafoo.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


[Found on std-discussion]

template<class T, class U>
struct Foo { };

template<class... Args>
void Bar(Foo<Args...> f)
{
}

template<class... Args>
void Baz()
{
    Foo<Args...> f;
}

int main()
{
    Foo<int, float> f;
    Bar(f);                    // #1
    Bar<int, float>(f);        // #2     
    Baz<int, float>();         // #3
}

Clang says:

<stdin>:19:5: error: no matching function for call to 'Bar'
    Bar<int, float>(f);        // #2
    ^~~~~~~~~~~~~~~
<stdin>:5:6: note: candidate template ignored: substitution failure [with Args
= <int, float>]: too many template arguments for class template 'Foo'
void Bar(Foo<Args...> f)
     ^   ~~~

This code looks valid to me.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list