File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
cpp/autosar/test/rules/A0-1-1 Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,15 @@ struct C {
2020void sample1 (int x){};
2121void 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+
2332int 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}
You can’t perform that action at this time.
0 commit comments