Skip to content

Commit 7fa8d1b

Browse files
Delete duplicated test block
1 parent 71e67e0 commit 7fa8d1b

File tree

2 files changed

+19
-34
lines changed

2 files changed

+19
-34
lines changed

cpp/misra/test/rules/RULE-10-1-1/PointerOrRefParamNotConst.expected

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,22 @@
2727
| test.cpp:91:20:91:21 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:91:5:91:5 | definition of operator() | function definition |
2828
| test.cpp:93:20:93:21 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:93:5:93:5 | definition of operator() | function definition |
2929
| test.cpp:95:20:95:21 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:95:5:95:5 | definition of operator() | function definition |
30-
| test.cpp:100:20:100:21 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:100:5:100:5 | definition of operator() | function definition |
31-
| test.cpp:102:20:102:21 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:102:5:102:5 | definition of operator() | function definition |
32-
| test.cpp:104:20:104:21 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:104:5:104:5 | definition of operator() | function definition |
33-
| test.cpp:106:20:106:21 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:106:5:106:5 | definition of operator() | function definition |
34-
| test.cpp:142:26:142:27 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:142:5:142:5 | definition of operator() | function definition |
35-
| test.cpp:143:26:143:27 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:143:5:143:5 | definition of operator() | function definition |
36-
| test.cpp:144:26:144:27 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:144:5:144:5 | definition of operator() | function definition |
37-
| test.cpp:145:26:145:27 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:145:5:145:5 | definition of operator() | function definition |
38-
| test.cpp:146:26:146:27 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:146:5:146:5 | definition of operator() | function definition |
39-
| test.cpp:147:26:147:27 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:147:5:147:5 | definition of operator() | function definition |
40-
| test.cpp:148:12:148:13 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:148:5:148:5 | definition of operator() | function definition |
41-
| test.cpp:149:12:149:13 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:149:5:149:5 | definition of operator() | function definition |
42-
| test.cpp:150:12:150:13 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:150:5:150:5 | definition of operator() | function definition |
43-
| test.cpp:151:12:151:13 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:151:5:151:5 | definition of operator() | function definition |
44-
| test.cpp:152:12:152:13 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:152:5:152:5 | definition of operator() | function definition |
45-
| test.cpp:153:12:153:13 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:153:5:153:5 | definition of operator() | function definition |
46-
| test.cpp:156:23:156:24 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:156:6:156:7 | definition of f5 | function definition |
47-
| test.cpp:159:23:159:24 | p4 | Parameter 'p4' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:156:6:156:7 | definition of f5 | function definition |
48-
| test.cpp:164:23:164:24 | p9 | Parameter 'p9' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:156:6:156:7 | definition of f5 | function definition |
49-
| test.cpp:165:23:165:25 | p10 | Parameter 'p10' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:156:6:156:7 | definition of f5 | function definition |
50-
| test.cpp:167:23:167:25 | p12 | Parameter 'p12' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:156:6:156:7 | definition of f5 | function definition |
51-
| test.cpp:198:12:198:13 | p2 | Parameter 'p2' points/refers to a non-const type 'S' but does not modify the target object in the $@. | test.cpp:197:6:197:7 | definition of f6 | function definition |
52-
| test.cpp:209:23:209:24 | p4 | Parameter 'p4' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:206:6:206:7 | definition of f7 | function definition |
30+
| test.cpp:131:26:131:27 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:131:5:131:5 | definition of operator() | function definition |
31+
| test.cpp:132:26:132:27 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:132:5:132:5 | definition of operator() | function definition |
32+
| test.cpp:133:26:133:27 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:133:5:133:5 | definition of operator() | function definition |
33+
| test.cpp:134:26:134:27 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:134:5:134:5 | definition of operator() | function definition |
34+
| test.cpp:135:26:135:27 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:135:5:135:5 | definition of operator() | function definition |
35+
| test.cpp:136:26:136:27 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:136:5:136:5 | definition of operator() | function definition |
36+
| test.cpp:137:12:137:13 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:137:5:137:5 | definition of operator() | function definition |
37+
| test.cpp:138:12:138:13 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:138:5:138:5 | definition of operator() | function definition |
38+
| test.cpp:139:12:139:13 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:139:5:139:5 | definition of operator() | function definition |
39+
| test.cpp:140:12:140:13 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:140:5:140:5 | definition of operator() | function definition |
40+
| test.cpp:141:12:141:13 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:141:5:141:5 | definition of operator() | function definition |
41+
| test.cpp:142:12:142:13 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:142:5:142:5 | definition of operator() | function definition |
42+
| test.cpp:145:23:145:24 | p1 | Parameter 'p1' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:145:6:145:7 | definition of f5 | function definition |
43+
| test.cpp:148:23:148:24 | p4 | Parameter 'p4' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:145:6:145:7 | definition of f5 | function definition |
44+
| test.cpp:153:23:153:24 | p9 | Parameter 'p9' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:145:6:145:7 | definition of f5 | function definition |
45+
| test.cpp:154:23:154:25 | p10 | Parameter 'p10' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:145:6:145:7 | definition of f5 | function definition |
46+
| test.cpp:156:23:156:25 | p12 | Parameter 'p12' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:145:6:145:7 | definition of f5 | function definition |
47+
| test.cpp:187:12:187:13 | p2 | Parameter 'p2' points/refers to a non-const type 'S' but does not modify the target object in the $@. | test.cpp:186:6:186:7 | definition of f6 | function definition |
48+
| test.cpp:198:23:198:24 | p4 | Parameter 'p4' points/refers to a non-const type 'int32_t' but does not modify the target object in the $@. | test.cpp:195:6:195:7 | definition of f7 | function definition |

cpp/misra/test/rules/RULE-10-1-1/test.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,6 @@ void f4() {
9696
return &p1;
9797
}; // NON_COMPLIANT
9898

99-
// Returning from reference parameters
100-
[](std::int32_t &p1) -> std::int32_t { return p1; }; // NON_COMPLIANT
101-
[](std::int32_t &p1) -> std::int32_t & { return p1; }; // COMPLIANT
102-
[](std::int32_t &p1) -> const std::int32_t & { return p1; }; // NON_COMPLIANT
103-
[](std::int32_t &p1) -> std::int32_t * { return &p1; }; // COMPLIANT
104-
[](std::int32_t &p1) -> const std::int32_t * { return &p1; }; // NON_COMPLIANT
105-
[](std::int32_t &p1) -> std::int32_t *const { return &p1; }; // COMPLIANT
106-
[](std::int32_t &p1) -> const std::int32_t *const {
107-
return &p1;
108-
}; // NON_COMPLIANT
109-
11099
// Non compliant cases are compliant when const
111100
using cpi32 = const std::int32_t *;
112101
using cri32 = const std::int32_t &;

0 commit comments

Comments
 (0)