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

`M0-1-2`: Only report when a path is infeasible in all possible templates

Open lcartey opened this issue 1 year ago • 0 comments

Affected rules

  • M0-1-2

Description

Similar to M0-1-1, the infeasible path query needs to consider whether a path is infeasible in any template instantiation.

Example

template <bool x>
int foo() {
  if (x) {
    return 1;
  }
  return 0;
}

void test() {
  foo<true>();
  foo<false>();
}

lcartey avatar Oct 02 '23 22:10 lcartey