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

A5-0-2: Conditions in uninstantiated templates raise false-positives #10

Closed
nicolaswill opened this issue Jul 15, 2022 · 0 comments · Fixed by #543
Closed

A5-0-2: Conditions in uninstantiated templates raise false-positives #10

nicolaswill opened this issue Jul 15, 2022 · 0 comments · Fixed by #543
Assignees
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 user-report Issue reported by an end user of CodeQL Coding Standards

Comments

@nicolaswill
Copy link
Contributor

nicolaswill commented Jul 15, 2022

Affected rules

  • M5-3-1
  • A5-0-2
    • cpp/autosar/non-boolean-if-condition
    • cpp/autosar/non-boolean-iteration-condition

Description

Iteration or if statements of type bool within uninstantiated templates have an unknown type and raise a false positive.

Example

template<T>
void foo(std::vector<T> & v) {
  for (typename std::vector<T>::iterator it{v.begin()}; it != v.end(); ++it) {
     (*it)++;
  }
}
@nicolaswill nicolaswill added Difficulty-Medium A false positive or false negative report which is expected to take 1-5 days effort to address Impact-Medium user-report Issue reported by an end user of CodeQL Coding Standards false positive/false negative An issue related to observed false positives or false negatives. labels Jul 15, 2022
@rvermeulen rvermeulen self-assigned this Feb 8, 2024
github-merge-queue bot pushed a commit that referenced this issue Mar 4, 2024
The query already deals with the case where the condition
is in an uninitialized template.
github-merge-queue bot pushed a commit that referenced this issue Mar 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 user-report Issue reported by an end user of CodeQL Coding Standards
Projects
Development

Successfully merging a pull request may close this issue.

2 participants