[LLVMbugs] [Bug 11848] New: pack expansion of alias template with non-dependent substitution fails

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jan 24 13:02:32 PST 2012


             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: unassignedclangbugs at nondot.org
        ReportedBy: richard-llvm at metafoo.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    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
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.

More information about the llvm-bugs mailing list