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

`A12-8-6`: Compiler generated special functions are not consistently flagged

Open lcartey opened this issue 1 year ago • 0 comments

Affected rules

  • A12-8-6

Description

Compiler generated special functions are not always flagged by this rule, because the extractor does not always generate them.

In CodeQL CLI v2.16.6 and before, this mainly affected non-template classes. However, after the upgrade to CodeQL CLI v2.18.4, special functions are not consistently generated for template classes either.

This can be addressed by extending the TrivialType library to support additional cases where the function would be compiler generated, but where it currently isn't detected.

Example

https://github.com/github/codeql-coding-standards/blob/adcb3805ea0a36d8944f63c2d7c761a501a2b379/cpp/autosar/test/rules/A12-8-6/test.cpp#L15

https://github.com/github/codeql-coding-standards/blob/adcb3805ea0a36d8944f63c2d7c761a501a2b379/cpp/autosar/test/rules/A12-8-6/test.cpp#L124

lcartey avatar Dec 05 '24 10:12 lcartey