http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52963

             Bug #: 52963
           Summary: Missing error on pack expansion
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: xinlian...@gmail.com


template <class T, class U> struct S {};
  template <typename... Ts> void f(Ts...);

  template <typename... Ts> struct X {
    template <typename... Us> void g() {
      f(S<Ts, Us>()...);
    }
  };

 void test(X<int, float> x) {
   x.g<int, float, double>();
 }


/*

oscar-wilde.cpp:6:18: error: pack expansion contains parameter packs 'Ts'
and 'Us' that have different lengths (2 vs. 3)
    f(S<Ts, Us>()...);
        ~~  ~~   ^
oscar-wilde.cpp:11:5: note: in instantiation of function template
specialization 'X<int, float>::g<int, float, double>' requested here
  x.g<int, float, double>();
    ^
1 error generated.

*/

Reply via email to