[LLVMbugs] [Bug 12057] New: Clang rejects lambda expressions in parameter packs

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Feb 21 12:17:59 PST 2012


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

             Bug #: 12057
           Summary: Clang rejects lambda expressions in parameter packs
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: dgregor at apple.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Clang is overly eager in its diagnosis of unexpanded parameter packs, assuming
that they cannot happen at statement boundaries. This is not the case, because
the following is well-formed but rejected by clang:


Cove:clang dgregor$ cat t2.cpp 
template<typename ...Fs>
void apply_function_objects(Fs ...fs);

template<typename ...Args>
void print_all(Args... args) {
  apply_function_objects([]() { print(args); }...);
}
Cove:clang dgregor$ clang++ -std=c++11 t2.cpp 
t2.cpp:6:33: error: expression contains unexpanded parameter pack 'args'
  apply_function_objects([]() { print(args); }...);
                                ^     ~~~~
t2.cpp:6:47: error: pack expansion does not contain any unexpanded parameter
      packs
  apply_function_objects([]() { print(args); }...);
                         ~~~~~~~~~~~~~~~~~~~~~^
2 errors generated.

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