https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84496

            Bug ID: 84496
           Summary: Internal compiler error with lambda, static and auto
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: damienrg+list at gmail dot com
  Target Milestone: ---

The following code produces an internal compiler error with g++ (7.3.0):

#include <functional>

void foo(std::function<void(int)> fun)
{}

int main()
{
  const auto f = []() {
    static int counter = 0;
    foo([](auto) { return counter; });
  };
}

Reply via email to