SUMMARY connect-3arg-lambda warns about possible issues with the lifetime of captured variables (by reference). This leads to false positives when not going back to the event loop (e.g. unittests using job.exec()) or in main() where there's no lifetime issues. This bug report is about main(). STEPS TO REPRODUCE Run clazy on any akonadi unittest which uses QTEST_AKONADIMAIN(MyObject) or do this directly: int result = 0; \ QTimer::singleShot(0, [argc, argv, &result]() { \ TestObject tc; \ result = QTest::qExec(&tc, argc, argv); \ qApp->quit(); \ }); \ app.exec(); \ OBSERVED RESULT Explanation for clazy-connect-3arg-lambda ./tests/auto/sugarcrmresource/test_sugarcrmresource.cpp line 585: QTEST_AKONADIMAIN(TestSugarCRMResource) => Pass a context object as 2nd singleShot parameter EXPECTED RESULT No warning in main() or more generally, no warning when followed by a call to .exec() but that seems a little bit too black magic, possibly?