codeql-coding-standards icon indicating copy to clipboard operation
codeql-coding-standards copied to clipboard

`A3-1-5`: Exclude instantiated templates and compiler generated members

Open lcartey opened this issue 2 years ago • 2 comments

Affected rules

  • A3-1-5

Description

Exclude instantiated templates from this rule here: https://github.com/github/codeql-coding-standards/blob/main/cpp/common/src/codingstandards/cpp/Class.qll#L184

Also exclude compiler generated members.

Example

lcartey avatar Oct 03 '23 16:10 lcartey

there is no example, so it is a bit unclear what the goal is - based on the cited library location already specifying member functions that are not involved in instantiated templates

however, when looking at this rule perhaps this issue had something to do with this part of the rule not being constrained to avoid template instantiations here

all in all, I think the rule logic needs more work though and that/any feedback this issue was describing will be captured in this issue

knewbury01 avatar Jan 31 '24 20:01 knewbury01

Apologies, I should have provided a permalink here, this was the line I meant we needed to change: https://github.com/github/codeql-coding-standards/blob/76440323596bc43ad125cbf8f3eb72c1b4c4933b/cpp/common/src/codingstandards/cpp/Class.qll#L195

lcartey avatar Jun 03 '24 15:06 lcartey