From c948efe09e3c2c872b6b1e15cefb196873f8c6eb Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 13 Nov 2026 14:22:21 +0100 Subject: [PATCH] C++: Accept regressions after github/codeql#23116 conflation fixes. --- ...PointerUsedWithNoOwnershipSharing.expected | 1 + cpp/autosar/test/rules/A20-8-4/test.cpp | 2 +- ...cCppLibraryFunctionsDoNotOverflow.expected | 2 + cpp/cert/test/rules/CTR52-CPP/test.cpp | 4 +- ...oseFilesWhenTheyAreNoLongerNeeded.expected | 47 ++++++++++--------- cpp/cert/test/rules/FIO51-CPP/test.cpp | 6 +-- .../IOFstreamMissingPositioning.expected | 7 --- .../iofstreammissingpositioning/test.cpp | 14 +++--- ...alueStoredInUnrelatedSmartPointer.expected | 17 ------- .../test.cpp | 2 +- ...NumberConversionMissingErrorCheck.expected | 4 ++ .../test.cpp | 8 ++-- 12 files changed, 51 insertions(+), 63 deletions(-) diff --git a/cpp/autosar/test/rules/A20-8-4/SharedPointerUsedWithNoOwnershipSharing.expected b/cpp/autosar/test/rules/A20-8-4/SharedPointerUsedWithNoOwnershipSharing.expected index f15f142b3b..84e48bc427 100644 --- a/cpp/autosar/test/rules/A20-8-4/SharedPointerUsedWithNoOwnershipSharing.expected +++ b/cpp/autosar/test/rules/A20-8-4/SharedPointerUsedWithNoOwnershipSharing.expected @@ -1,3 +1,4 @@ | test.cpp:14:24:14:26 | sp3 | The ownership of shared_ptr $@ is not shared within or passed out of the local scope of function $@. | test.cpp:14:24:14:26 | sp3 | sp3 | test.cpp:11:22:11:23 | f1 | f1 | | test.cpp:16:24:16:26 | sp5 | The ownership of shared_ptr $@ is not shared within or passed out of the local scope of function $@. | test.cpp:16:24:16:26 | sp5 | sp5 | test.cpp:11:22:11:23 | f1 | f1 | | test.cpp:17:24:17:26 | sp6 | The ownership of shared_ptr $@ is not shared within or passed out of the local scope of function $@. | test.cpp:17:24:17:26 | sp6 | sp6 | test.cpp:11:22:11:23 | f1 | f1 | +| test.cpp:18:24:18:26 | sp7 | The ownership of shared_ptr $@ is not shared within or passed out of the local scope of function $@. | test.cpp:18:24:18:26 | sp7 | sp7 | test.cpp:11:22:11:23 | f1 | f1 | diff --git a/cpp/autosar/test/rules/A20-8-4/test.cpp b/cpp/autosar/test/rules/A20-8-4/test.cpp index 3dfdc163f3..a2e2c05791 100644 --- a/cpp/autosar/test/rules/A20-8-4/test.cpp +++ b/cpp/autosar/test/rules/A20-8-4/test.cpp @@ -15,7 +15,7 @@ std::shared_ptr f1() { std::shared_ptr sp4 = std::make_shared(0); // COMPLIANT std::shared_ptr sp5 = std::make_shared(0); // NON_COMPLIANT std::shared_ptr sp6; // NON_COMPLIANT - std::shared_ptr sp7; // COMPLIANT + std::shared_ptr sp7; // COMPLIANT [FALSE POSITIVE] shared_ptr_obj_param(sp1); shared_ptr_ref_param(sp2); diff --git a/cpp/cert/test/rules/CTR52-CPP/GuaranteeGenericCppLibraryFunctionsDoNotOverflow.expected b/cpp/cert/test/rules/CTR52-CPP/GuaranteeGenericCppLibraryFunctionsDoNotOverflow.expected index 4e87d1436c..a21adcd58a 100644 --- a/cpp/cert/test/rules/CTR52-CPP/GuaranteeGenericCppLibraryFunctionsDoNotOverflow.expected +++ b/cpp/cert/test/rules/CTR52-CPP/GuaranteeGenericCppLibraryFunctionsDoNotOverflow.expected @@ -1,5 +1,7 @@ | test.cpp:8:42:8:46 | call to begin | Output iterator for $@ is not guaranteed to be large enough for the input iterator. | test.cpp:8:3:8:11 | call to copy | call to copy | +| test.cpp:13:42:13:46 | call to begin | Output iterator for $@ is not guaranteed to be large enough for the input iterator. | test.cpp:13:3:13:11 | call to copy | call to copy | | test.cpp:17:42:17:46 | call to begin | Output iterator for $@ is not guaranteed to be large enough for the input iterator. | test.cpp:17:3:17:11 | call to copy | call to copy | +| test.cpp:49:42:49:46 | call to begin | Output iterator for $@ is not guaranteed to be large enough for the input iterator. | test.cpp:49:3:49:11 | call to copy | call to copy | | test.cpp:55:42:55:46 | call to begin | Output iterator for $@ is not guaranteed to be large enough for the input iterator. | test.cpp:55:3:55:11 | call to copy | call to copy | | test.cpp:59:36:59:40 | call to begin | Output iterator for $@ is not guaranteed to be large enough for the input iterator. | test.cpp:59:3:59:13 | call to copy_n | call to copy_n | | test.cpp:60:45:60:49 | call to begin | Output iterator for $@ is not guaranteed to be large enough for the input iterator. | test.cpp:60:3:60:14 | call to copy_if | call to copy_if | diff --git a/cpp/cert/test/rules/CTR52-CPP/test.cpp b/cpp/cert/test/rules/CTR52-CPP/test.cpp index 2669287ab7..e866029595 100644 --- a/cpp/cert/test/rules/CTR52-CPP/test.cpp +++ b/cpp/cert/test/rules/CTR52-CPP/test.cpp @@ -10,7 +10,7 @@ void test_basic(std::vector from) { void test_basic_good(std::vector &src) { std::vector dest(src.size()); - std::copy(src.begin(), src.end(), dest.begin()); // COMPLIANT + std::copy(src.begin(), src.end(), dest.begin()); // COMPLIANT [FALSE POSITIVE] } void test_non_local_bad(std::vector &src, std::vector &dest) { @@ -46,7 +46,7 @@ void test_back_inserter(std::vector &src) { void test_fixed_size_correct() { std::vector dest(10); std::vector src(10); - std::copy(src.begin(), src.end(), dest.begin()); // COMPLIANT + std::copy(src.begin(), src.end(), dest.begin()); // COMPLIANT [FALSE POSITIVE] } void test_fixed_size_broken() { diff --git a/cpp/cert/test/rules/FIO51-CPP/CloseFilesWhenTheyAreNoLongerNeeded.expected b/cpp/cert/test/rules/FIO51-CPP/CloseFilesWhenTheyAreNoLongerNeeded.expected index 90ac0969f6..e3b81eaf20 100644 --- a/cpp/cert/test/rules/FIO51-CPP/CloseFilesWhenTheyAreNoLongerNeeded.expected +++ b/cpp/cert/test/rules/FIO51-CPP/CloseFilesWhenTheyAreNoLongerNeeded.expected @@ -1,22 +1,27 @@ | test.cpp:6:3:6:16 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:5:21:5:27 | call to basic_fstream | call to basic_fstream | -| test.cpp:63:3:63:16 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:58:10:58:13 | call to open | call to open | -| test.cpp:77:3:77:16 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:70:9:70:9 | call to operator<< | call to operator<< | -| test.cpp:91:5:91:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:89:8:89:8 | call to operator>> | call to operator>> | -| test.cpp:94:5:94:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:92:8:92:13 | call to gcount | call to gcount | -| test.cpp:97:5:97:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:95:8:95:10 | call to get | call to get | -| test.cpp:100:5:100:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:98:8:98:14 | call to getline | call to getline | -| test.cpp:103:5:103:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:101:8:101:13 | call to ignore | call to ignore | -| test.cpp:106:5:106:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:104:8:104:11 | call to peek | call to peek | -| test.cpp:109:5:109:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:107:8:107:11 | call to read | call to read | -| test.cpp:112:5:112:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:110:8:110:15 | call to readsome | call to readsome | -| test.cpp:115:5:115:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:113:8:113:14 | call to putback | call to putback | -| test.cpp:118:5:118:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:116:8:116:12 | call to unget | call to unget | -| test.cpp:121:5:121:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:119:8:119:12 | call to tellg | call to tellg | -| test.cpp:124:5:124:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:122:8:122:12 | call to seekg | call to seekg | -| test.cpp:127:5:127:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:125:8:125:11 | call to sync | call to sync | -| test.cpp:130:5:130:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:128:8:128:8 | call to operator<< | call to operator<< | -| test.cpp:133:5:133:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:131:8:131:10 | call to put | call to put | -| test.cpp:136:5:136:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:134:8:134:12 | call to write | call to write | -| test.cpp:139:5:139:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:137:8:137:12 | call to tellp | call to tellp | -| test.cpp:142:5:142:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:140:8:140:12 | call to seekp | call to seekp | -| test.cpp:145:5:145:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:143:8:143:12 | call to flush | call to flush | +| test.cpp:17:3:17:16 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:10:21:10:27 | call to basic_fstream | call to basic_fstream | +| test.cpp:30:3:30:16 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:22:23:22:29 | call to basic_fstream | call to basic_fstream | +| test.cpp:44:3:44:16 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:34:16:34:19 | call to basic_fstream | call to basic_fstream | +| test.cpp:63:3:63:16 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:48:16:48:19 | call to basic_fstream | call to basic_fstream | +| test.cpp:77:3:77:16 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:68:22:68:28 | call to basic_fstream | call to basic_fstream | +| test.cpp:77:3:77:16 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:69:22:69:29 | call to basic_fstream | call to basic_fstream | +| test.cpp:88:5:88:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:82:21:82:27 | call to basic_fstream | call to basic_fstream | +| test.cpp:91:5:91:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:82:21:82:27 | call to basic_fstream | call to basic_fstream | +| test.cpp:94:5:94:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:82:21:82:27 | call to basic_fstream | call to basic_fstream | +| test.cpp:97:5:97:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:82:21:82:27 | call to basic_fstream | call to basic_fstream | +| test.cpp:100:5:100:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:82:21:82:27 | call to basic_fstream | call to basic_fstream | +| test.cpp:103:5:103:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:82:21:82:27 | call to basic_fstream | call to basic_fstream | +| test.cpp:106:5:106:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:82:21:82:27 | call to basic_fstream | call to basic_fstream | +| test.cpp:109:5:109:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:82:21:82:27 | call to basic_fstream | call to basic_fstream | +| test.cpp:112:5:112:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:82:21:82:27 | call to basic_fstream | call to basic_fstream | +| test.cpp:115:5:115:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:82:21:82:27 | call to basic_fstream | call to basic_fstream | +| test.cpp:118:5:118:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:82:21:82:27 | call to basic_fstream | call to basic_fstream | +| test.cpp:121:5:121:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:82:21:82:27 | call to basic_fstream | call to basic_fstream | +| test.cpp:124:5:124:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:82:21:82:27 | call to basic_fstream | call to basic_fstream | +| test.cpp:127:5:127:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:82:21:82:27 | call to basic_fstream | call to basic_fstream | +| test.cpp:130:5:130:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:82:21:82:27 | call to basic_fstream | call to basic_fstream | +| test.cpp:133:5:133:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:82:21:82:27 | call to basic_fstream | call to basic_fstream | +| test.cpp:136:5:136:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:82:21:82:27 | call to basic_fstream | call to basic_fstream | +| test.cpp:139:5:139:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:82:21:82:27 | call to basic_fstream | call to basic_fstream | +| test.cpp:142:5:142:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:82:21:82:27 | call to basic_fstream | call to basic_fstream | +| test.cpp:145:5:145:18 | call to terminate | The execution terminates without closing the `fstream` last accessed in $@. | test.cpp:82:21:82:27 | call to basic_fstream | call to basic_fstream | diff --git a/cpp/cert/test/rules/FIO51-CPP/test.cpp b/cpp/cert/test/rules/FIO51-CPP/test.cpp index fe0e16c0eb..df04db184d 100644 --- a/cpp/cert/test/rules/FIO51-CPP/test.cpp +++ b/cpp/cert/test/rules/FIO51-CPP/test.cpp @@ -14,7 +14,7 @@ void test_closed() { file.close(); if (file.fail()) { } - std::terminate(); // COMPLIANT + std::terminate(); // COMPLIANT [FALSE POSITIVE] } void test_fail() { @@ -27,7 +27,7 @@ void test_fail() { if (file.fail()) { } } - std::terminate(); // COMPLIANT + std::terminate(); // COMPLIANT [FALSE POSITIVE] } void test_scope() { @@ -41,7 +41,7 @@ void test_scope() { if (file.fail()) { } } - std::terminate(); // COMPLIANT + std::terminate(); // COMPLIANT [FALSE POSITIVE] } void test_sequence() { diff --git a/cpp/common/test/rules/iofstreammissingpositioning/IOFstreamMissingPositioning.expected b/cpp/common/test/rules/iofstreammissingpositioning/IOFstreamMissingPositioning.expected index d5afdf5e5a..f525724df1 100644 --- a/cpp/common/test/rules/iofstreammissingpositioning/IOFstreamMissingPositioning.expected +++ b/cpp/common/test/rules/iofstreammissingpositioning/IOFstreamMissingPositioning.expected @@ -1,9 +1,2 @@ -| test.cpp:10:11:10:11 | call to operator>> | Missing call to positioning function before $@. | test.cpp:9:11:9:11 | call to operator<< | call to operator>> | -| test.cpp:11:11:11:11 | call to operator<< | Missing call to positioning function before $@. | test.cpp:10:11:10:11 | call to operator>> | call to operator<< | -| test.cpp:19:11:19:11 | call to operator>> | Missing call to positioning function before $@. | test.cpp:18:11:18:11 | call to operator<< | call to operator>> | -| test.cpp:31:8:31:8 | call to operator<< | Missing call to positioning function before $@. | test.cpp:29:8:29:8 | call to operator>> | call to operator<< | -| test.cpp:41:12:41:12 | call to operator>> | Missing call to positioning function before $@. | test.cpp:40:6:40:6 | call to operator<< | call to operator>> | -| test.cpp:42:6:42:6 | call to operator<< | Missing call to positioning function before $@. | test.cpp:41:12:41:12 | call to operator>> | call to operator<< | | test.cpp:52:14:52:14 | call to operator<< | Missing call to positioning function before $@. | test.cpp:51:14:51:14 | call to operator>> | call to operator<< | | test.cpp:63:12:63:12 | call to operator<< | Missing call to positioning function before $@. | test.cpp:62:12:62:12 | call to operator>> | call to operator<< | -| test.cpp:103:12:103:12 | call to operator<< | Missing call to positioning function before $@. | test.cpp:99:12:99:12 | call to operator>> | call to operator<< | diff --git a/cpp/common/test/rules/iofstreammissingpositioning/test.cpp b/cpp/common/test/rules/iofstreammissingpositioning/test.cpp index e1f90acfe8..42d02de37d 100644 --- a/cpp/common/test/rules/iofstreammissingpositioning/test.cpp +++ b/cpp/common/test/rules/iofstreammissingpositioning/test.cpp @@ -7,8 +7,8 @@ std::string str("output:"); void test_local() { std::fstream f_local("file"); f_local << "some data"; // COMPLIANT - f_local >> str; // NON_COMPLIANT - f_local << "more data"; // NON_COMPLIANT + f_local >> str; // NON_COMPLIANT [MISSING] + f_local << "more data"; // NON_COMPLIANT [MISSING] f_local.seekp(0); f_local >> str; // COMPLIANT }; @@ -16,7 +16,7 @@ void test_local2() { std::fstream f_local("file"); f_local << "some data"; // COMPLIANT f_local << "more data"; // COMPLIANT - f_local >> str; // NON_COMPLIANT + f_local >> str; // NON_COMPLIANT [MISSING] f_local >> str; // COMPLIANT }; @@ -28,7 +28,7 @@ void test_2streams() { f_s1 << "some data"; f_s2 >> str; // COMPLIANT f_s1.seekp(0); - f_s2 << "some data"; // NON_COMPLIANT + f_s2 << "some data"; // NON_COMPLIANT [MISSING] f_s1 >> str; // COMPLIANT } @@ -38,8 +38,8 @@ void test_alias() { std::fstream &alias_f1 = f1; f1 << "some data"; - alias_f1 >> str; // NON_COMPLIANT - f1 << "more data"; // NON_COMPLIANT + alias_f1 >> str; // NON_COMPLIANT [MISSING] + f1 << "more data"; // NON_COMPLIANT [MISSING] } // class member variable @@ -100,5 +100,5 @@ void test_branch(int rand) { if (rand > 10) { f_branch.seekp(0); } - f_branch << "more data"; // NON_COMPLIANT + f_branch << "more data"; // NON_COMPLIANT [MISSING] } diff --git a/cpp/common/test/rules/ownedpointervaluestoredinunrelatedsmartpointer/OwnedPointerValueStoredInUnrelatedSmartPointer.expected b/cpp/common/test/rules/ownedpointervaluestoredinunrelatedsmartpointer/OwnedPointerValueStoredInUnrelatedSmartPointer.expected index 00f3128a8b..8ac513d503 100644 --- a/cpp/common/test/rules/ownedpointervaluestoredinunrelatedsmartpointer/OwnedPointerValueStoredInUnrelatedSmartPointer.expected +++ b/cpp/common/test/rules/ownedpointervaluestoredinunrelatedsmartpointer/OwnedPointerValueStoredInUnrelatedSmartPointer.expected @@ -1,8 +1,6 @@ problems | test.cpp:5:27:5:28 | v1 | test.cpp:4:13:4:14 | v1 | test.cpp:5:27:5:28 | v1 | Raw pointer flows to initialize multiple unrelated smart pointers. | | test.cpp:5:27:5:28 | v1 | test.cpp:16:13:16:22 | new | test.cpp:5:27:5:28 | v1 | Raw pointer flows to initialize multiple unrelated smart pointers. | -| test.cpp:6:31:6:33 | call to get | test.cpp:4:13:4:14 | v1 | test.cpp:6:31:6:33 | call to get | Raw pointer flows to initialize multiple unrelated smart pointers. | -| test.cpp:6:31:6:33 | call to get | test.cpp:16:13:16:22 | new | test.cpp:6:31:6:33 | call to get | Raw pointer flows to initialize multiple unrelated smart pointers. | | test.cpp:7:28:7:29 | v2 | test.cpp:4:13:4:14 | v1 | test.cpp:7:28:7:29 | v2 | Raw pointer flows to initialize multiple unrelated smart pointers. | | test.cpp:7:28:7:29 | v2 | test.cpp:16:13:16:22 | new | test.cpp:7:28:7:29 | v2 | Raw pointer flows to initialize multiple unrelated smart pointers. | | test.cpp:11:28:11:29 | v2 | test.cpp:10:8:10:17 | new | test.cpp:11:28:11:29 | v2 | Raw pointer flows to initialize multiple unrelated smart pointers. | @@ -11,18 +9,10 @@ problems edges | test.cpp:3:14:3:15 | v1 | test.cpp:4:13:4:14 | v1 | provenance | | | test.cpp:3:14:3:15 | v1 | test.cpp:5:27:5:28 | v1 | provenance | | -| test.cpp:3:14:3:15 | v1 | test.cpp:5:27:5:28 | v1 | provenance | | | test.cpp:4:13:4:14 | v1 | test.cpp:4:13:4:14 | v1 | provenance | | | test.cpp:4:13:4:14 | v1 | test.cpp:5:27:5:28 | v1 | provenance | | -| test.cpp:4:13:4:14 | v1 | test.cpp:5:27:5:28 | v1 | provenance | | | test.cpp:4:13:4:14 | v1 | test.cpp:7:28:7:29 | v2 | provenance | | | test.cpp:4:13:4:14 | v1 | test.cpp:7:28:7:29 | v2 | provenance | | -| test.cpp:5:24:5:25 | call to shared_ptr | test.cpp:6:28:6:29 | p1 | provenance | | -| test.cpp:5:24:5:25 | call to shared_ptr | test.cpp:6:28:6:29 | p1 | provenance | | -| test.cpp:5:27:5:28 | v1 | test.cpp:5:24:5:25 | call to shared_ptr | provenance | Config | -| test.cpp:5:27:5:28 | v1 | test.cpp:5:24:5:25 | call to shared_ptr | provenance | Config | -| test.cpp:6:28:6:29 | p1 | test.cpp:6:31:6:33 | call to get | provenance | Config | -| test.cpp:6:28:6:29 | p1 | test.cpp:6:31:6:33 | call to get | provenance | Config | | test.cpp:8:3:8:14 | ... = ... | test.cpp:9:28:9:29 | v2 | provenance | | | test.cpp:8:8:8:14 | 0 | test.cpp:8:3:8:14 | ... = ... | provenance | | | test.cpp:10:3:10:17 | ... = ... | test.cpp:11:28:11:29 | v2 | provenance | | @@ -39,14 +29,7 @@ nodes | test.cpp:4:13:4:14 | v1 | semmle.label | v1 | | test.cpp:4:13:4:14 | v1 | semmle.label | v1 | | test.cpp:4:13:4:14 | v1 | semmle.label | v1 | -| test.cpp:5:24:5:25 | call to shared_ptr | semmle.label | call to shared_ptr | -| test.cpp:5:24:5:25 | call to shared_ptr | semmle.label | call to shared_ptr | -| test.cpp:5:27:5:28 | v1 | semmle.label | v1 | -| test.cpp:5:27:5:28 | v1 | semmle.label | v1 | | test.cpp:5:27:5:28 | v1 | semmle.label | v1 | -| test.cpp:6:28:6:29 | p1 | semmle.label | p1 | -| test.cpp:6:28:6:29 | p1 | semmle.label | p1 | -| test.cpp:6:31:6:33 | call to get | semmle.label | call to get | | test.cpp:7:28:7:29 | v2 | semmle.label | v2 | | test.cpp:8:3:8:14 | ... = ... | semmle.label | ... = ... | | test.cpp:8:8:8:14 | 0 | semmle.label | 0 | diff --git a/cpp/common/test/rules/ownedpointervaluestoredinunrelatedsmartpointer/test.cpp b/cpp/common/test/rules/ownedpointervaluestoredinunrelatedsmartpointer/test.cpp index 81408e70a2..0e9ad1e642 100644 --- a/cpp/common/test/rules/ownedpointervaluestoredinunrelatedsmartpointer/test.cpp +++ b/cpp/common/test/rules/ownedpointervaluestoredinunrelatedsmartpointer/test.cpp @@ -3,7 +3,7 @@ void f2(int *v1) { int *v2 = v1; std::shared_ptr p1(v1); // NON_COMPLIANT - new std::shared_ptr(p1.get()); // NON_COMPLIANT + new std::shared_ptr(p1.get()); // NON_COMPLIANT [MISSING] new std::shared_ptr(v2); // NON_COMPLIANT v2 = nullptr; new std::shared_ptr(v2); // COMPLIANT diff --git a/cpp/common/test/rules/stringnumberconversionmissingerrorcheck/StringNumberConversionMissingErrorCheck.expected b/cpp/common/test/rules/stringnumberconversionmissingerrorcheck/StringNumberConversionMissingErrorCheck.expected index dd540aff7b..706761fb7b 100644 --- a/cpp/common/test/rules/stringnumberconversionmissingerrorcheck/StringNumberConversionMissingErrorCheck.expected +++ b/cpp/common/test/rules/stringnumberconversionmissingerrorcheck/StringNumberConversionMissingErrorCheck.expected @@ -1,8 +1,12 @@ | test.cpp:9:5:9:5 | call to operator>> | Error state not checked after call to string-to-numeric conversion function operator>>. | | test.cpp:15:33:15:33 | call to operator>> | Error state not checked after call to string-to-numeric conversion function operator>>. | +| test.cpp:51:5:51:5 | call to operator>> | Error state not checked after call to string-to-numeric conversion function operator>>. | | test.cpp:58:5:58:5 | call to operator>> | Error state not checked after call to string-to-numeric conversion function operator>>. | +| test.cpp:64:5:64:5 | call to operator>> | Error state not checked after call to string-to-numeric conversion function operator>>. | | test.cpp:105:12:105:12 | call to operator>> | Error state not checked after call to string-to-numeric conversion function operator>>. | | test.cpp:112:6:112:6 | call to operator>> | Error state not checked after call to string-to-numeric conversion function operator>>. | +| test.cpp:129:5:129:5 | call to operator>> | Error state not checked after call to string-to-numeric conversion function operator>>. | | test.cpp:134:5:134:5 | call to operator>> | Error state not checked after call to string-to-numeric conversion function operator>>. | +| test.cpp:141:5:141:5 | call to operator>> | Error state not checked after call to string-to-numeric conversion function operator>>. | | test.cpp:180:6:180:6 | call to operator>> | Error state not checked after call to string-to-numeric conversion function operator>>. | | test.cpp:186:34:186:34 | call to operator>> | Error state not checked after call to string-to-numeric conversion function operator>>. | diff --git a/cpp/common/test/rules/stringnumberconversionmissingerrorcheck/test.cpp b/cpp/common/test/rules/stringnumberconversionmissingerrorcheck/test.cpp index 494aab4c85..ef8a146e0c 100644 --- a/cpp/common/test/rules/stringnumberconversionmissingerrorcheck/test.cpp +++ b/cpp/common/test/rules/stringnumberconversionmissingerrorcheck/test.cpp @@ -48,7 +48,7 @@ void test_correct_exceptions() { std::basic_istream s(0); s.exceptions(std::istream::failbit | std::istream::badbit); int x; - s >> x; // COMPLIANT - will throw an exceptions + s >> x; // COMPLIANT - will throw an exceptions [FALSE POSITIVE] } void test_incomplete_exceptions_non_compliant() { @@ -61,7 +61,7 @@ void test_incomplete_exceptions_non_compliant() { void test_exceptions_but_after() { std::basic_istream s(0); int x; - s >> x; // COMPLIANT - will throw an exception on `exceptions` below + s >> x; // COMPLIANT - will throw an exception on `exceptions` below [FALSE POSITIVE] // exceptions will cause an exception to be thrown if any of the failbits are // already set s.exceptions(std::istream::failbit | std::istream::badbit); @@ -126,7 +126,7 @@ void init_stream(std::basic_istream &s) { void readInt(std::basic_istream &s) { int x; - s >> x; // COMPLIANT - all sources have exceptions enabled + s >> x; // COMPLIANT - all sources have exceptions enabled [FALSE POSITIVE] } void readInt2(std::basic_istream &s) { @@ -138,7 +138,7 @@ void test_non_local_exceptions_enabled_compliant() { std::basic_istream s(0); init_stream(s); int x; - s >> x; // COMPLIANT - throws an exception + s >> x; // COMPLIANT - throws an exception [FALSE POSITIVE] std::basic_istream s1(0); init_stream(s1); readInt(s1);