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.
7679 Discussions

C++14 recursive lambda missing operator()

olzhas_r_
New Contributor I
247 Views
void foo() {
  auto bar = [](auto& self) -> void {
    return self(self);
  };
  bar(bar);
}

 

icc 17.0.2 produces the following error:

main.cc(3): error: call of an object of a class type without appropriate operator() or conversion functions to pointer-to-function type
      return self(self);
             ^
          detected during instantiation of function "lambda [](auto &)->void [with <auto-1>=lambda [](auto &)->void]" at line 5

 

0 Kudos
4 Replies
Yuan_C_Intel
Employee
247 Views

Hi,

Thank you for reporting this issue.

Could you report this in our new cloud service at www.intel.com/supporttickets?

Our support engineer will follow up on this bug report.

Thank you!

olzhas_r_
New Contributor I
247 Views

Hi Yolanda,

Could you please fill this bug with the 'support' website for me?

It feels so much hassle; I gave up quick.

 

olzhas_r_
New Contributor I
247 Views

This is still an issue with icc 18 initial release.

Melanie_B_Intel
Employee
247 Views

I created cmplrs-45676 in our internal bugs database, thanks for bringing this to our attention again. --Melanie

Reply