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

A7-1-1: Ignore dummy base variable in recursive variable templates #621

Closed
lcartey opened this issue Jun 10, 2024 · 0 comments · Fixed by #636
Closed

A7-1-1: Ignore dummy base variable in recursive variable templates #621

lcartey opened this issue Jun 10, 2024 · 0 comments · Fixed by #636
Assignees
Labels
Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Low Phase III Standard-AUTOSAR user-report Issue reported by an end user of CodeQL Coding Standards

Comments

@lcartey
Copy link
Collaborator

lcartey commented Jun 10, 2024

Affected rules

  • A7-1-1

Description

A recursive variable template definition can cause CodeQL to produce a dummy variable at the base case of the recursion.

Example

template <bool... Args> extern constexpr bool all_of_v = true; // COMPLIANT[FALSE_POSITIVE]

template <bool B1, bool... Args>
extern constexpr bool all_of_v<B1, Args...> = B1 &&all_of_v<Args...>;

void test() {
  all_of_v<true, true, true>;}
@lcartey lcartey added Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Low user-report Issue reported by an end user of CodeQL Coding Standards labels Jun 10, 2024
@knewbury01 knewbury01 self-assigned this Jul 5, 2024
@knewbury01 knewbury01 moved this from Triaged to In Progress in Coding Standards Public Development Board Jul 5, 2024
@knewbury01 knewbury01 moved this from In Progress to Ready for review in Coding Standards Public Development Board Jul 5, 2024
@github-project-automation github-project-automation bot moved this from Ready for review to Done in Coding Standards Public Development Board Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Low Phase III Standard-AUTOSAR user-report Issue reported by an end user of CodeQL Coding Standards
Projects
Development

Successfully merging a pull request may close this issue.

3 participants