-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Internal Code
-
None
-
Fully Compatible
-
Execution Team 2020-10-19
There are parts of the codebase that suffer fromĀ const return by value and const pass by value.
These can be caught by clang tidy, and we would like to add rules to do so. This and this are two clang tidy rules that could help us do so.
However, there is one issue to watch out for:
A const qualifier is often used on a pass-by-value param in the implementation file (here's an example). This is a readability enhancement. The reader of the function will now know that the function will not touch modify that param. This usage of the const qualifier shouldn't be flagged.
- is related to
-
SERVER-27984 Add clang-tidy run in addition to lint
- Closed
-
SERVER-49800 add use-after-move rule to clang-tidy evergreen builder
- Closed
-
SERVER-50165 parallelize clang-tidy task
- Closed
- related to
-
SERVER-57428 Coverity analysis defect 120147: Parse warning
- Closed
-
SERVER-53580 restore const qualifiers to arguments in test function definitions
- Closed
- links to