| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
refactor(cxx): list lambda captures explicitly What: - Every lambda that used a default capture ([&], or [&, x]) now names what it captures, across src, selfdev, tools, samples and the ibmw-template project. A former [&] lists each variable by reference (&name) plus this where members are used; explicit captures that were already there are kept unchanged, so what is captured and how is the same as before. - The capture lists were derived from the compiler: the default capture was removed and every "not captured" error added that name, until the translation unit compiled again. Lambdas the build does not compile (other feature flags, OHOS-only and Fast DDS 3 code, the IBMW_DRIVER_ENTRY macro) were done by hand. - The copied Fibonacci action client in the generated sample follows its source. Why: the code check forbids default lambda captures; naming the captures shows which locals a lambda (often running on another thread) keeps references to. Verification: build-ci full build without errors; ctest 75/75; files outside the build compiled with a synthetic command (with and without the core metrics, comm trace and reporter flags) without new errors; clang -Wunused-lambda-capture reports no unused capture; scripts/regen_in_tree.sh reproduces the generated samples; clang-format clean. Signed-off-by: fanglinxu <fanglinxu@huawei.com> | 5 天前 |