[LLVMbugs] [Bug 11850] New: empty function parameter pack expansions before the end of the parameter list don't work

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jan 24 15:30:17 PST 2012


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

             Bug #: 11850
           Summary: empty function parameter pack expansions before the
                    end of the parameter list don't work
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: richard-llvm at metafoo.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


This crashes clang:

template<typename ...T> struct S {
  int f(T...a, int b) { return b; }
};
S<> s;
int k = s.f(0);

... like so:

lib/Sema/SemaTemplateInstantiateDecl.cpp:2549: void
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl *, bool, bool): Assertion `FParamIdx <
Function->getNumParams()' failed.



This is rejected:

template<typename ...T> void f(T...a, int b) {}
template void f<>(int b);

... like so:

<stdin>:2:15: error: explicit instantiation of 'f' does not refer to a function
      template, member function, member class, or static data member
template void f<>(int b);
              ^

I believe both of these cases should work.

-- 
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