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

Commitdcd22fd

Browse files
authored
Merge pull request#186 from github/jeongsoolee09/a13-5-2
Address False Positives for Autosar A13-5-2
2 parents7490a0c +8f29669 commitdcd22fd

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-`A13-5-2` - address a false positive where lambda expressions with empty captures were being flagged as having a non-compliant conversion operator.

‎cpp/autosar/src/rules/A13-5-2/UserDefinedConversionOperatorsNotDefinedExplicit.ql‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ class ExplicitConversionOperator extends ConversionOperator {
2727
fromConversionOperatorop
2828
where
2929
notisExcluded(op, OperatorsPackage::userDefinedConversionOperatorsNotDefinedExplicitQuery())and
30-
notopinstanceofExplicitConversionOperator
30+
notopinstanceofExplicitConversionOperatorand
31+
notop.isCompilerGenerated()
3132
selectop,"User-defined conversion operator is not explicit."

‎cpp/autosar/test/rules/A13-5-2/test.cpp‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,15 @@ class A {
88
operatorint()const {return d; }// NON_COMPLIANT
99
private:
1010
float d;
11-
};
11+
};
12+
13+
voidtest_compiler_generated() {
14+
int x =0;
15+
16+
auto capture = [x]() ->int {return x; };
17+
18+
auto no_capture = []() ->int {
19+
int x =1;
20+
return x;
21+
};
22+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp