Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
7681 Discussions

lambda variadic capture bug with icc 2016

rnickb
Beginner
136 Views

The following code compiles fine with gcc and clang but fails with icc

template<class... T>                                                             
void f(T... args) {                                                              
  auto lambda = [&](auto func) {                                                 
    return func(args...);                                                        
  };                                                                             
}                                                                                
int main() {                                                                     
  f(3, 7, 2);                                                                    
  return 0;                                                                      
}

icc gives this error:

main.cpp(4): error: pack expansion does not make use of any argument packs

      return func(args...);

                      ^

          detected during instantiation of "void f(T...) [with T=<int, int, int>]" at line 9

 

compilation aborted for main.cpp (code 2)

0 Kudos
1 Reply
Amanda_S_Intel
Employee
136 Views

Thanks for your report. I submitted this issue to the development team (DPD200369002).

Reply