Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lcartey opened this issue Dec 5, 2024 · 0 comments
Labels
Difficulty-Medium A false positive or false negative report which is expected to take 1-5 days effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium

Comments

@lcartey
Copy link
Collaborator

lcartey commented Dec 5, 2024

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

class BaseClass2 {}; // NON_COMPLIANT - compiler generated move and assignment

template <class T> class BaseClass9 { // NON_COMPLIANT

@lcartey lcartey added Difficulty-Medium A false positive or false negative report which is expected to take 1-5 days effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium labels Dec 5, 2024
@lcartey lcartey moved this from Reported to Triaged in Coding Standards Public Development Board Dec 5, 2024
lcartey added a commit that referenced this issue Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty-Medium A false positive or false negative report which is expected to take 1-5 days effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium
Projects
Development

No branches or pull requests

1 participant