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

--- Comment #6 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Ivan Lazaric from comment #5)
> On condition with an otherwise unused variable:
> IMO the following is reasonable:
> ```cpp
> // in body of main:
> int process_count = ...;
> int process_limit = ...;
> 
> auto launch_process = [&, &process_limit] pre(process_count < process_limit)
> {
>   // ... forking ...
>   ++process_count;
> };
> ```
> 
> Notable is `process_limit` variable is never used in the body,
> only in the precondition.

No, but it is explicitly captured which is allowed by
https://eel.is/c++draft/expr.prim.lambda#closure-10

I have an additional fix for the ICEs caused by the capture-uses, which I will
hopefully post later today.

Reply via email to