25 C++ Cases That Will Humble You

Parasoft C++test findings dashboard · C++ Doctor (Jelle Bakker) case repo · C++23 / GCC 13.3
C++test Professional 2025.2.0
2026-11-04 · 25 standalone cases · line-level scoring
6/25
bugs detected outright
MISRA C++ 2023 + FA Aggressive
▲ 4 more than Recommended Rules
3
flagged: right line, right hazard family
(cases 16, 20, 22)
indirect but purposeful rules
12/25
fully invisible
no finding anywhere on the bug
▼ needs sanitizers / other tools
177
findings in the combined config
13 land on bug lines
39 in Recommended Rules

Configuration comparison best-of per config

ConfigurationFindingsOn bug lineDetectedFlaggedIncidental
Recommended Rules392 / 252——
Flow Analysis Standard85 / 2541—
Flow Analysis Aggressive85 / 2541—
MISRA C++ 2023 + Flow Analysis Aggressive (custom merged)17713 / 25633
Flow Analysis Aggressive alone added nothing over Standard on these 25 files. Merging a coding standard with aggressive flow analysis more than doubles real coverage: 9 of 25 bugs get a purposeful finding (6 detected + 3 flagged) versus 5 with flow analysis alone and 2 with Recommended Rules.

Verdict split 25 cases

Detected outright6 · 24%
Flagged (right line, right hazard family)3 · 12%
Incidental style hit on the bug line3 · 12%
Case is a puzzle, not a bug1 · 4%
Fully invisible12 · 48%
MISRA C++ 2023 + Flow Analysis Aggressive, line-level scoring against cases.json ground truth.

The 13 findings that land on a bug line MISRA C++ 2023 + Flow Analysis Aggressive

CaseLineRuleSeverityTierMessage
11 Greetings From Who?13BD-CO-STRMODSev 1detectedThe invalidated "ptr" pointer to the "text" container is used
12 Think You're a Bit Wise?13BD-PB-VALRANGESev 4detectedThe "this->ages" variable may be accessed out of bounds at index "person", which may be greater or equal to the container size
1213MISRACPP2023-7_0_4-aSev 2detectedThe LHS/RHS operand of bitwise operator '&=' should be unsigned (bitwise AND on a bool, the exact construct)
13 An Offer You Can't Refuse12MISRACPP2023-8_0_1-bSev 4detectedThe condition of the '?:' operator should be in parentheses, plus BD-PB-CC and 0_0_2-a: condition "price + (int)isMember" always evaluates to true
15 Works In Production15BD-PB-VCTOR MISRACPP2023-15_1_1-aSev 2detectedVirtual method "getSpecialty" called on the "CppDoctor" object ("specialist") which is under construction
19 A Wrong Move22MISRACPP2023-4_6_1-bSev 2detectedThe code depends on the order of evaluation of 'getBody' function arguments — the exact use-after-move bug; clang-tidy is the only other tool that catches it
24 No Strings Attached34MISRACPP2023-7_0_2-aSev 2detectedDo not convert type 'const char [4]' to type 'bool' — the exact overload-resolution bug (plus 8_2_7-c / 8_2_8-b)
16 Have You Tried Upgrading?23MISRACPP2023-9_5_2-aSev 2flaggedThe for-range-initializer contains 2 function calls — a rule built precisely for the range-for temporary trap
20 Is Anybody Playing?11MISRACPP2023-7_0_3-aSev 2flaggedThe numerical value of a character shall not be used — fires on the char-promotion comparison the bug needs
22 Running in Circles29MISRACPP2023-0_3_1-d BD-PB-ZEROSev 4 Sev 1flaggedInfinity or NaN may be returned as a result of division by zero constant, plus 0_3_1-b on the float '!=' — the NaN entrance is flagged; the mutual recursion is not
18 A Short Stack23MISRACPP2023-6_9_2-aSev 4incidentalDo not use the 'int' standard integer type — on the line, wrong reason
21 What Comes First?16MISRACPP2023-9_3_1-bSev 2incidental'if' should be followed by a block — style, coincidental
25 The Uninvited Temporary28MISRACPP2023-8_1_2-aSev 4incidentalImplicitly captured variables in a non-transient lambda — style, coincidental
6 255 + 110MISRACPP2023-7_0_5-aSev 2no bugIntegral promotion shall not change signedness 'uint8_t' to 'int' — flags the puzzle construct; case 6 is not a defect
Severity is the Parasoft severity level C++test reports per finding (1 = highest, 4 = lowest), taken from the sev attribute of each violation in report.xml. Every rule pill links to the Parasoft documentation search for that rule ID: docs.parasoft.com does not host per-rule pages for C++test, the full rule documentation ships inside the product (Help → rule docs, or manuals/cpptest_rules.pdf). Hover a rule pill for its official title.

Per-case verdicts MISRA C++ 2023 + Flow Analysis Aggressive · 177 findings

#CaseRoot causeFindingsVerdictWhat C++test says (or why silent)
1The Eternal Buttonshared_ptr reference cycle6missedOwnership-cycle reasoning absent; LeakSanitizer catches it
2Timing Is Everythingmember order vs thread lifetime4missedthread start in ctor / join in dtor not modeled; TSan catches it
3Self Destructionuse-after-free via callback5missedstd::function re-entry not traced; ASan catches it
4Self Destruction IIlambda destroys own captures5missedlambda-object capture model absent; ASan catches it
5Calling Into the Voidpure virtual call during destruction8missedjoin-in-destructor vs running thread not modeled; aborts at runtime on GCC
6255 + 1integral promotion (puzzle)4no bugMISRA 7_0_5-a flags the promotion twice, on the exact line
7Starting From Zeroaccumulate initial-value type2missedconversion hidden in std headers; GCC -Wconversion catches it
8Hello Worldofstream recreation ordering2missedassignment sequencing semantics; no rule
9Did It Even Count?thread copies arguments6missedstd::thread value semantics not modeled
10G4rb&g#static destruction order fiasco10missedwhole-program static destruction ordering not modeled
11Greetings From Who?dangling data() pointer3detectedBD-CO-STRMOD on the use line
12Think You're a Bit Wise?&= without short-circuit, OOB7detectedBD-PB-VALRANGE + MISRA 7_0_1-a, 7_0_4-a
13An Offer You Can't Refuseternary precedence12detectedMISRA 8_0_1-b + BD-PB-CC + MISRA 0_0_2-a
14A Wrong Status Reportdangling string_view from ternary8missedternary common-type temporary lifetime not modeled
15Works In Productionvirtual call on sibling base in ctor10detectedBD-PB-VCTOR + MISRA 15_1_1-a
16Have You Tried Upgrading?dangling range-for temporary7flaggedMISRA 9_5_2-a: 2 function calls in for-range-initializer
17A Changing Referencealiasing reference mutated in loop4missedaliasing logic, not lifetime or bounds
18A Short Stackinitializer-list ctor trap9incidental6_9_2-a on the line for an unrelated reason; constructor selection legal
19A Wrong Moveunspecified evaluation order / use-after-move7detectedMISRA 4_6_1-b: code depends on argument evaluation order
20Is Anybody Playing?char signedness portability11flaggedMISRA 7_0_3-a on the char promotion comparison
21What Comes First?comparator breaks strict weak ordering9incidental9_3_1-b style hit; semantic contract not checked
22Running in CirclesNaN + mutual recursion stack overflow9flagged0_3_1-d NaN may result + BD-PB-ZERO + 0_3_1-b float !=
23A Lock You Can't Seestatic-init mutex in real-time code4missedneeds Clang RealtimeSanitizer
24No Strings Attachedstring literal converts to bool14detectedMISRA 7_0_2-a + 8_2_7-c + 8_2_8-b on the call line
25The Uninvited Temporaryimplicit conversion mutates vector mid-iteration11incidental8_1_2-a style hit; invalidation path not modeled

Rule mix 177 findings, top rules

Sev 4 6_0_3-a global namespace shall only contain main/namespaces30
Sev 4 18_3_1-a at least one catch-all exception handler25
Sev 2 6_2_3-a external linkage, one external definition25
Sev 4 6_9_2-a do not use standard signed/unsigned integer types16
Sev 4 6_5_1-a external-linkage objects declared in headers11
Sev 2 15_0_1-a special member functions provided appropriately8
Sev 2 7_0_3-a numerical value of a character shall not be used6
everything else (34 rules)56
The 13 bug-line findings come from 11 distinct rules. The violet structural rules dominate the noise floor: in 25 single-file demo programs they fire on every translation unit by design.

Why the 12 invisible bugs stay invisible

Dynamic behavior (9)1, 2, 3, 4, 5, 9, 10, 17, 25: refcount cycles, thread join in destructor, callback re-entry, thread argument copies, static destruction order, aliasing. Flow analysis is path/value based; it has no model of std::function dispatch, std::thread copies or jthread joins.
Temporary semantics (3)7, 8, 14: truncation hidden in std headers, ofstream recreation ordering, ternary common-type temporaries. String invalidation is modeled (case 11 was caught); these siblings are not.
Contracts (2)21 strict weak ordering and 23 real-time no-locking live outside the type system: they need libc++ hardening and RealtimeSanitizer.
What C++test cannot replaceSanitizers catch 1, 2, 3, 4, 5, 14, 25; Clang warnings catch 13, 24 (also caught here); clang-tidy catches 19 (also caught here); GCC -Wconversion catches 7. Cases 6, 17, 18, 20 are the book's true "understand the language" territory.
Recommended Rules found 2/25. Flow Analysis alone 5/25. MISRA C++ 2023 + Flow Analysis Aggressive: 9/25 purposeful (6 detected + 3 flagged) plus 3 incidental style hits. The delta over flow analysis alone comes almost entirely from MISRA semantic rules: 4_6_1-b (19), 7_0_2-a (24), 8_0_1-b (13), 15_1_1-a (15), 9_5_2-a (16), 7_0_3-a (20).

Method

ItemValue
ToolParasoft C++test Professional 2025.2.0 (10.7.3.20251120B2939), cpptestcli
Cases25 standalone programs transcribed verbatim from "25 C++ Cases That Will Humble You" (Jelle Bakker, C++ Doctor, 2026)
Compiler importGCC 13.3.0, C++23, pthreads; custom <print> shim for libstdc++ 13
Configurationsbuiltin Recommended Rules / Flow Analysis Standard / Flow Analysis Aggressive; custom merged config: 277 MISRA C++ 2023 rules + 147 aggressive flow checkers (reportUnvalidatedViolations + aggressiveMode on)
ScoringA case is "hit" only if a finding's line equals a ground-truth bug line in cases.json. Tiers: detected = finding expresses the bug; flagged = right line and hazard family, indirect rule; incidental = style rule coincidentally on the line
RepositoryC:\Projects\CPPdoctor\cppdoctor-25-cases · reproduce with ./run_cpptest.sh + python3 parse_findings.py
Severity & rule docsSeverity levels come from the sev attribute of each violation in report.xml (Parasoft scale: 1 highest, 4 lowest here). Rule titles come from the rule documentation bundled with C++test (rules/docs.zip). Parasoft does not publish per-rule pages on docs.parasoft.com, so each rule pill opens the documentation search for that rule ID; the documentation space lives at docs.parasoft.com/display/CPPTEST20261