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

--- Comment #4 from kuzniar95 at o2 dot pl ---
I meant that dropping constness:

char ch = '='; // OK

results in an error:

lambda.cpp: In lambda function:
lambda.cpp:4:23: error: ‘ch’ is not captured
    4 |     [](auto) { return ch; }; // OK
      |                       ^~
lambda.cpp:4:6: note: the lambda has no capture-default
    4 |     [](auto) { return ch; }; // OK
      |      ^
lambda.cpp:2:7: note: ‘char ch’ declared here
    2 |  char ch = '=';
      |       ^~

which is actually good.

Reply via email to