[LLVMbugs] [Bug 13135] New: Assertion when using class template with multiple parameter packs

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jun 18 02:50:29 PDT 2012


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

             Bug #: 13135
           Summary: Assertion when using class template with multiple
                    parameter packs
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jonathan.sauer at gmx.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 8723
  --> http://llvm.org/bugs/attachment.cgi?id=8723
Full log of clang run

The following program crashes clang r158654:

template <typename...>
struct Tuple;

template <typename..., typename...>
struct Foo;

template <typename... A, typename... B>
struct Foo<Tuple<A...>, Tuple<B...>> {
    typedef Tuple<A..., B...>   type;
};

// Only crashes when this typedef exists (otherwise only the correct error is
// raised)
typedef Foo<Tuple<>, Tuple<>>::type Bar;


This results in (full log attached):

$ ~/LLVM/build/Release+Asserts/bin/clang++ -v -std=c++11 clang.cpp
clang version 3.2 (trunk 158654)
Target: x86_64-apple-darwin10.8.0
Thread model: posix
[...]
clang.cpp:4:11: error: template parameter pack must be the last template
parameter
template <typename..., typename...>
          ^
Assertion failed: (ArgIdx == NumArgs - 1 && "Pack not at the end of argument
list?"), function hasTemplateArgumentForDeduction, file
/Users/rynnsauer/LLVM/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp, line
1666.


While the error raised is correct, the assertion most likely is not.

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