C++14 recursive lambda missing operator()

C++14 recursive lambda missing operator()

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

 

Thread Topic: 

Bug Report
5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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!

Hi Yolanda,

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

It feels so much hassle; I gave up quick.

 

This is still an issue with icc 18 initial release.

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

Leave a Comment

Please sign in to add a comment. Not a member? Join today