Skip to content

Commit f0b53e2

Browse files
committed
Update expected results of RULE-9-5-2
1 parent 23aa711 commit f0b53e2

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

cpp/misra/src/rules/RULE-9-5-2/ForRangeInitializerAtMostOneFunctionCall.ql

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
import cpp
2020
import codingstandards.cpp.misra
2121

22-
from RangeBasedForStmt foreach, string message
22+
from RangeBasedForStmt foreach, Expr initializer
2323
where
2424
not isExcluded(foreach, StatementsPackage::forRangeInitializerAtMostOneFunctionCallQuery()) and
25-
count(Call call | call = foreach.getRange().getAChild*() | call) >= 2 and
26-
message = "has nested call expression in its initializer"
27-
select foreach, "Range-based for loop " + message + "."
25+
initializer = foreach.getRange() and
26+
count(Call call | call = initializer.getAChild*() | call) >= 2
27+
select foreach, "Range-based for loop has nested call expression in its $@.", initializer,
28+
"initializer"
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
| test.cpp:48:3:49:3 | for(...:...) ... | Range-based for loop has nested call expression in its initializer. |
2-
| test.cpp:56:3:59:3 | for(...:...) ... | Range-based for loop has nested call expression in its initializer. |
3-
| test.cpp:71:3:73:3 | for(...:...) ... | Range-based for loop has nested call expression in its initializer. |
4-
| test.cpp:95:3:97:3 | for(...:...) ... | Range-based for loop has nested call expression in its initializer. |
5-
| test.cpp:99:3:101:3 | for(...:...) ... | Range-based for loop has nested call expression in its initializer. |
6-
| test.cpp:103:3:107:3 | for(...:...) ... | Range-based for loop has nested call expression in its initializer. |
7-
| test.cpp:116:3:119:3 | for(...:...) ... | Range-based for loop has nested call expression in its initializer. |
8-
| test.cpp:121:3:124:3 | for(...:...) ... | Range-based for loop has nested call expression in its initializer. |
1+
| test.cpp:48:3:49:3 | for(...:...) ... | Range-based for loop has nested call expression in its $@. | test.cpp:48:17:48:27 | call to processData | initializer |
2+
| test.cpp:56:3:59:3 | for(...:...) ... | Range-based for loop has nested call expression in its $@. | test.cpp:57:8:57:32 | call to vector | initializer |
3+
| test.cpp:71:3:73:3 | for(...:...) ... | Range-based for loop has nested call expression in its $@. | test.cpp:71:17:72:21 | call to MyContainer | initializer |
4+
| test.cpp:95:3:97:3 | for(...:...) ... | Range-based for loop has nested call expression in its $@. | test.cpp:95:26:95:26 | call to operator+ | initializer |
5+
| test.cpp:99:3:101:3 | for(...:...) ... | Range-based for loop has nested call expression in its $@. | test.cpp:99:31:99:31 | call to operator+ | initializer |
6+
| test.cpp:103:3:107:3 | for(...:...) ... | Range-based for loop has nested call expression in its $@. | test.cpp:104:18:104:18 | call to operator+ | initializer |
7+
| test.cpp:116:3:119:3 | for(...:...) ... | Range-based for loop has nested call expression in its $@. | test.cpp:117:8:117:25 | call to convertToIntVector | initializer |
8+
| test.cpp:121:3:124:3 | for(...:...) ... | Range-based for loop has nested call expression in its $@. | test.cpp:122:8:122:25 | call to convertToIntVector | initializer |

0 commit comments

Comments
 (0)