Summary: |
lambda-in-connect false positive, when a lambda is nested in another lambda |
Product: |
[Developer tools] clazy
|
Reporter: |
julien.cugniere |
Component: |
general | Assignee: |
Unassigned bugs <unassigned-bugs-null> |
Status: |
REPORTED
---
|
|
|
Severity: |
normal
|
CC: |
julien.cugniere, smartins, vaclav
|
Priority: |
NOR
|
|
|
Version First Reported In: |
unspecified | |
|
Target Milestone: |
--- | |
|
Platform: |
Other | |
|
OS: |
Microsoft Windows | |
|
Latest Commit:
|
|
Version Fixed In:
|
|
Sentry Crash Report:
|
|
| |
Attachments: |
lambda-in-connect-false-positive.cpp
|
Created attachment 142163 [details] lambda-in-connect-false-positive.cpp SUMMARY lambda-in-connect false positive when a capturing lambda is nested inside the connected lambda. STEPS TO REPRODUCE 1. Run clazy on attached file lambda-in-connect-false-positive.cpp OBSERVED RESULT lambda-in-connect-false-positive.cpp(8,4): warning: captured local variable by reference might go out of scope before lambda is called [-Wclazy-lambda-in-connect] foo++; EXPECTED RESULT No warning. The connected lambda is not capturing foo (only the nested lambda is), so there's no risk. SOFTWARE/OS VERSIONS Windows: 21H1 Qt Version: Qt 5.15.2 clazy_v1.8-msvc2019.zip as build by KDAB (File lambda-in-connect.cpp has no commits between 1.8 and master). ADDITIONAL INFORMATION If the connected lambda is capturing by reference something other than foo, the warning should still not appear.