[LLVMbugs] [Bug 14858] New: Parameter pack expanded into alias template incorrectly

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jan 8 17:26:32 PST 2013


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

             Bug #: 14858
           Summary: Parameter pack expanded into alias template
                    incorrectly
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: zilla at kayari.org
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


count::value should equal sizeof...(T) in this code, but is always 1, causing
the assertions to fail.

Tested with clang 3.0 and 3.3 (trunk 170278)



template<int N> struct Int { static const int value = N; };

template<typename... T>
  using Count = Int<sizeof...(T)>;

template<typename... T>
struct test
{
  typedef Count< T... > count;

  static_assert( count::value == sizeof...(T), "clang can count" );
};

template struct test<int>;        // OK

template struct test<>;         // fails

template struct test<int, int>;     // fails

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