Skip to content

Commit 423328b

Browse files
committed
Add supposed FP case
1 parent 5c3ccd1 commit 423328b

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

cpp/autosar/test/rules/A0-1-1/test.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ struct C {
2020
void sample1(int x){};
2121
void sample2(int y){};
2222

23+
static void foo(B &b) noexcept {
24+
b.g();
25+
B bar{};
26+
bar.g();
27+
B b2 = B();
28+
auto b3 = &b2;
29+
b3->g();
30+
}
31+
2332
int test_useless_assignment(int &x, int p) {
2433
x = 0; // COMPLIANT - x is a reference parameter, so is visible by the caller
2534
int y = 0; // NON_COMPLIANT - never used
@@ -75,9 +84,9 @@ int test_useless_assignment(int &x, int p) {
7584
A a7{1, 2}; // COMPLIANT - used in the `sample1` call below
7685
sample1(a7.f + a7.f2); // COMPLIANT - object access is a valid use
7786

78-
A *a8; // COMPLIANT - value not given at declaration
79-
a8 = &a7;
80-
sample2(a8->f); // COMPLIANT - object access is a valid use
87+
// A *a8; // COMPLIANT - value not given at declaration
88+
// a8 = &a7;
89+
// sample2(a8->f); // COMPLIANT - object access is a valid use
8190

8291
return y;
8392
}

0 commit comments

Comments
 (0)