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

             Bug #: 11848
           Summary: pack expansion of alias template with non-dependent
                    substitution fails
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++0x
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


template<typename> using I = int;

template<typename T, typename...Ts>
int f(I<T> i, I<Ts> ...is) {
  return i + f<Ts>(is...);
};

int k = f<char, double, float>(1, 2, 3);


This causes clang to assert:

src/tools/clang/lib/AST/ASTContext.cpp:2680: clang::QualType
clang::ASTContext::getPackExpansionType(clang::QualType,
llvm::Optional<unsigned int>): Assertion
`Pattern->containsUnexpandedParameterPack() && "Pack expansions must expand one
or more parameter packs"' failed.

The root cause here is presumably that the alias template contains an
unexpanded parameter pack, but its canonical type does not.

I'm not entirely sure whether this is supposed to be legal: on one hand, the
pattern clearly names a parameter pack, but on the other hand, an alias
template is supposed to be equivalent to its substitution, and its substitution
does not name a parameter pack.

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to