...
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 | Remediation Cost | Priority | Level |
|---|---|---|---|---|---|
DCL52-CPP | Low | Unlikely | Low | P3 | L3 |
Automated Detection
Tool | Version | Checker | Description |
|---|
| Axivion Bauhaus Suite |
| CertC++-DCL52 | |||||||
| Helix QAC |
| C++0014 | |||||||
| Klocwork |
|
14
| 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. | ||||||
| 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 |
Related Vulnerabilities
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" |
...
...