Skip to content

Commit ee08b4f

Browse files
authored
Merge pull request #639 from MathiasVP/accept-test-changes-from-16969
C++: Accept test changes from #16969
2 parents 8e691fa + e32a4e4 commit ee08b4f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cpp/common/test/rules/validcontainerelementaccess/ValidContainerElementAccess.expected

+2
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@
77
| test.cpp:89:15:89:16 | it | Elements of $@ not accessed with valid reference, pointer, or iterator because of a prior $@. | test.cpp:86:20:86:20 | d | container | test.cpp:92:7:92:12 | call to insert | invalidation |
88
| test.cpp:91:9:91:10 | it | Elements of $@ not accessed with valid reference, pointer, or iterator because of a prior $@. | test.cpp:86:20:86:20 | d | container | test.cpp:92:7:92:12 | call to insert | invalidation |
99
| test.cpp:98:56:98:58 | loc | Elements of $@ not accessed with valid reference, pointer, or iterator because of a prior $@. | test.cpp:96:44:96:46 | str | container | test.cpp:99:9:99:14 | call to insert | invalidation |
10+
| test.cpp:99:5:99:7 | str | Elements of $@ not accessed with valid reference, pointer, or iterator because of a prior $@. | test.cpp:96:44:96:46 | str | container | test.cpp:99:9:99:14 | call to insert | invalidation |
1011
| test.cpp:99:16:99:18 | loc | Elements of $@ not accessed with valid reference, pointer, or iterator because of a prior $@. | test.cpp:96:44:96:46 | str | container | test.cpp:99:9:99:14 | call to insert | invalidation |
12+
| test.cpp:106:11:106:13 | str | Elements of $@ not accessed with valid reference, pointer, or iterator because of a prior $@. | test.cpp:103:45:103:47 | str | container | test.cpp:106:15:106:20 | call to insert | invalidation |

cpp/common/test/rules/validcontainerelementaccess/test.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ void f8(const int *ar) {
9696
void f9(const std::string &s, std::string &str) {
9797
std::string::iterator loc = str.begin();
9898
for (auto i = s.begin(), e = s.end(); i != e; ++i, ++loc) { // NON_COMPLIANT
99-
str.insert(loc, 'c'); // NON_COMPLIANT
99+
str.insert(loc, 'c'); // NON_COMPLIANT[FALSE POSITIVE for str]
100100
}
101101
}
102102

103103
void f10(const std::string &s, std::string &str) {
104104
std::string::iterator loc = str.begin();
105105
for (auto i = s.begin(), e = s.end(); i != e; ++i, ++loc) { // COMPLIANT
106-
loc = str.insert(loc, 'c'); // COMPLIANT
106+
loc = str.insert(loc, 'c'); // COMPLIANT[FALSE POSITIVE]
107107
}
108108
}
109109

0 commit comments

Comments
 (0)