[SERVER-25668] Add lint rule to ban names reserved by the C++ standard Created: 17/Aug/16 Updated: 29/Aug/23 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | David Storch | Assignee: | Backlog - Service Architecture |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | lint | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Service Arch
|
| Participants: |
| Description |
|
The C++ standard reserves identifiers containing a double underscore (__) and identifiers that begin with an underscore followed by a capital letter A through Z (_[A-Z]). The codebase currently contains a few instances of these reserved identifiers. For instance, https://github.com/mongodb/mongo/blob/r3.3.10/src/mongo/unittest/unittest.h#L103 We should clean up existing usages of reserved names and add a lint rule to enforce that they aren't added in the future. |
| Comments |
| Comment by Alex Neben [ 29/Aug/23 ] |
|
This seems like a good idea for a clang-tidy rule. Sending it over to service arch. |