Examples of errors detected by the V1047 diagnostic
V1047. Lifetime of the lambda is greater than lifetime of the local variable captured by reference.
OrcaSlicer
V1047 Lifetime of the lambda is greater than lifetime of the local variable 'do_stop' captured by reference. FillBedJob.cpp 250
void FillBedJob::process(Ctl &ctl)
{
// ....
bool do_stop = false;
// ....
params.on_packed =
[&do_stop] (const ArrangePolygon &ap)
{
do_stop = ap.bed_idx > 0 && ap.priority == 0;
};
// ....
}
Similar errors can be found in some other places:
- V1047 Lifetime of the lambda is greater than lifetime of the local variable 'statustxt' captured by reference. FillBedJob.cpp 245
- V1047 Lifetime of the lambda is greater than lifetime of the local variable 'do_stop' captured by reference. FillBedJob.cpp 241