
...
A const
or volatile
reference type may result in undefined behavior instead of a fatal diagnostic, causing unexpected values to be stored and leading to possible data integrity violations.
Rule | Severity | Likelihood | Detectable | RepairableRemediation Cost | Priority | Level |
---|---|---|---|---|---|---|
DCL52-CPP | Low | Unlikely | Yes | YesLow | P3 | L3 |
Automated Detection
Tool | Version | Checker | Description | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Axivion Bauhaus Suite |
| CertC++-DCL52 | ||||||||||||
Helix QAC |
| C++0014 | ||||||||||||
Klocwork |
| CERT.DCL.REF_TYPE.CONST_OR_VOLATILE | ||||||||||||
Parasoft C/C++test |
| CERT_CPP-DCL52-a | Never qualify a reference type with 'const' or 'volatile' | |||||||||||
Polyspace Bug Finder |
| CERT C++: DCL52-CPP | Checks for:
Rule fully covered. | PRQA QA-C++ | ||||||||||
Include Page | PRQA QA-C++_V | PRQA QA-C++_V | 0014||||||||||||
Clang |
| Clang checks for violations of this rule and produces an error without the need to specify any special flags or options. | ||||||||||||
SonarQube C/C++ Plugin |
| S3708 |
...
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Bibliography
[Dewhurst 2002] | Gotcha #5, "Misunderstanding References" |
[ISO/IEC 14882-2014] | Subclause 8.3.2, "References" |
...