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 {
20
20
void sample1 (int x){};
21
21
void sample2 (int y){};
22
22
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
+
23
32
int test_useless_assignment (int &x, int p) {
24
33
x = 0 ; // COMPLIANT - x is a reference parameter, so is visible by the caller
25
34
int y = 0 ; // NON_COMPLIANT - never used
@@ -75,9 +84,9 @@ int test_useless_assignment(int &x, int p) {
75
84
A a7{1 , 2 }; // COMPLIANT - used in the `sample1` call below
76
85
sample1 (a7.f + a7.f2 ); // COMPLIANT - object access is a valid use
77
86
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
81
90
82
91
return y;
83
92
}
You can’t perform that action at this time.
0 commit comments