This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/47226] New: GCC doesn't expand template parameter pack that appears in a lambda-expression


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

           Summary: GCC doesn't expand template parameter pack that
                    appears in a lambda-expression
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: schaub.johannes@googlemail.com


GCC doesn't like this:

  void slurp(...) { } 
  template<int ...N> 
  void print() { 
    slurp([]() -> int { 
      (void) N; // or something fancy...
      return 0; 
    }() ...); 
  }

  void f() { print<1, 2>(); }

Error:

  error: parameter packs not expanded with '...':

I think the draft (n3225) says this should expand "N" and result in: 

  slurp(
    []() -> int { 
      (void) 1; // or something fancy...
      return 0; 
    }(),
    []() -> int { 
      (void) 2; // or something fancy...
      return 0; 
    }());


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]