Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A13-5-2: False positive on lambda with empty captures #178

Closed
Assignees
jeongsoolee09
Labels
Difficulty-LowA false positive or false negative report which is expected to take <1 day effort to addressImpact-Highfalse positive/false negativeAn issue related to observed false positives or false negatives.top-25-fpsuser-reportIssue reported by an end user of CodeQL Coding Standards
@touhead

Description

@touhead

Affected rules

  • A13-5-2

Description

TheA13-5-2 (cpp/autosar/user-defined-conversion-operators-not-defined-explicit) rule triggers on lambda with empty captures.

Example

int ref_value{0};int other_value{0};// okauto dummy_lambda = [&ref_value]()noexcept ->void { ref_value =42; };dummy_lambda();// okauto my_lambda_1 = [&ref_value](int param)noexcept ->void {for (int i{0}; i < param; ++i) {    ++ref_value;  }};my_lambda_1(other_value);// error: user-defined-conversion-operators-not-defined-explicitauto my_lambda_2 = [](int param)noexcept ->void {for (int i{0}; i < param; ++i) {//  }};my_lambda_2(other_value);// okauto my_lambda_3 = [&ref_value](int param)noexcept ->void { ref_value = param; };my_lambda_3(other_value);

Metadata

Metadata

Assignees

Labels

Difficulty-LowA false positive or false negative report which is expected to take <1 day effort to addressImpact-Highfalse positive/false negativeAn issue related to observed false positives or false negatives.top-25-fpsuser-reportIssue reported by an end user of CodeQL Coding Standards

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp