Skip to content

v2.63.0

Latest

Choose a tag to compare

@github-actions github-actions released this 16 Nov 18:07
5f8af55

Release summary

  • No new queries were added for this release
  • The following changes have been made for this release:
  • A0-1-3, RULE-0-2-4 - UnusedLocalFunction.ql:
    • Fixed false positives for private pure virtual functions used through the non-virtual
      interface (NVI) idiom. DynamicCallGraph::getTarget() resolves a virtual call to the
      implementations that may actually run; a pure virtual function has no body, so it is
      never a viable dispatch target and was reported as unused even when a sibling member
      called it. A call is now also counted when the function is the statically named
      callee. Pure virtual functions that are genuinely never called and never overridden
      are still reported.
    • Excluded private member functions of class templates that are never concretely
      instantiated anywhere in the database (and where no sibling member of the same
      class-template pattern is instantiated either). Clang never elaborates a body for the
      members of such patterns, so calls between sibling members of the same
      never-instantiated class (e.g. a public entry point calling a private helper) cannot be
      resolved by the call graph. This is common for generic "plumbing" library code
      (CRTP-style wrappers, etc.) that is only ever
      instantiated by downstream consumers outside of the analyzed codebase.
  • RULE-5-10-1 - PoorlyFormedIdentifier.ql:
    • Avoid false positives for none user defined identifiers like PRETTY_FUNCTION
  • RULE-10-0-1, M8-0-1 - MultipleLocalDeclarators.qll:
    • Added a check to ignore structured bindings from C++17, which are explicitly allowed by RULE 10-0-1 and serve a unique useful purpose.
  • RULE-7-0-1 - NoConversionFromBool.ql:
    • Fixed false positives where a bool value is bound to a reference whose
      referenced type is also bool (e.g. bool&, const bool&), including
      when this happens via a generic/forwarding-reference parameter (e.g.
      template<class T> void f(T&& t), or class template forwarding
      constructors such as std::pair's pair(U1&&, U2&&)) that happens to be
      instantiated with bool. Binding a value to a reference of its own type
      does not change the type or representation of the value, so this is not
      a conversion from bool in the sense intended by the rule.
  • RULE-7-0-4 - InappropriateBitwiseOrShiftOperands.ql:
    • Fixes #1177 - the rule no longer reports operands whose type is not a MISRA numeric type. The
      operand checks used not isUnsignedType(operandType), which is vacuously true for every type
      that has no MISRA numeric type at all, such as class types and the unresolved dependent types
      of uninstantiated template bodies. As a result the rule reported operations that do not use
      the built-in operators, most notably the stream insertion and extraction operators. The checks
      now use isSignedType(operandType) instead.
    • Operands of character type, of a non-standard integral type, and of an unscoped enumeration
      type without a fixed underlying type are consequently no longer reported, because none of them
      has a MISRA numeric type. Unscoped enumerations without a fixed underlying type are covered by
      RULE-10-2-3.
  • RULE-5-10-1 - PoorlyFormedIdentifier.ql:
    • Fixed false positives where a local variable or function parameter was reported as
      "defined in reserved namespace" merely because its enclosing function is the body of
      an explicit template specialization that C++ permits users to add to namespace std
      (for example, std::hash<UserType>::operator()'s parameter and local names).
  • RULE-7-0-2 - NoImplicitBoolConversion.ql:
    • Fixed false positives where a conversion's source expression type could
      not be resolved to a concrete type (UnknownType), which occurs only in
      template-dependent contexts that the extractor cannot resolve, e.g. a
      constexpr bool variable template whose initializer is itself another
      dependent variable template such as std::conjunction_v<...>.
    • Fixed false positives on reference-dereference conversions (bool&/
      bool&& to bool), which occur e.g. via the compiler-synthesized
      std::get<N>(...) call used to implement structured binding
      decomposition (auto [a, b] = some_pair_or_tuple_expr; where b is
      bool). Dereferencing a reference to bool does not change the type or
      representation of the value, so this is not a conversion to bool in
      the sense intended by the rule.
  • EXP37-C - DoNotCallFunctionsWithIncompatibleArguments.ql:
    • Improved query evaluation performance. Query results are unchanged.
  • DIR-4-10, M16-2-3, and RULE-19-2-1:
    • Header files matched by a configured exclusion are no longer reported.
  • All queries using Iterators.qll or STLContainers.qll:
    • The means of detecting iterator and container accesses has been optimized to improve performance by avoiding construction of the full transitive closure of local taint paths.
  • MSC39-C - DoNotCallVaArgOnAVaListThatHasAnIndeterminateValue.ql:
    • Updated to use the new ir-based DataFlow module for tracking va_list usage. The new data flow will provide a different set of false positives and negatives compared to the previous implementation, but generally has higher precision.
  • RULE-13-3-1 - MemberSpecifiersNotUsedAppropriately.ql:
    • Fixed false positives on implicitly declared member functions, most
      commonly the implicit destructor of a class deriving from a class with a
      virtual destructor. The rule applies to user-declared member functions
      only, and an implicit destructor cannot carry override or final.
  • RULE-15-1-3 - NonExplicitConversionMember.ql:
    • Fixed false positives on the compiler-generated conversion operator of a
      captureless lambda's closure type (conversion to a function pointer). This
      operator is implicit by definition and cannot be declared explicit.
  • RULE-5-13-4, M2-13-3 - UnsignedIntegerLiteralsNotAppropriatelySuffixed.ql, MissingUSuffix.ql:
    • Remove false positives for literals in macro expansions (e.g. 0U), as the suffix information is lost in this case. This is consistent with RULE-7-2.

Supported versions

  • The LGTM pack is not supported on any released version of LGTM without support from GitHub Professional Services.
  • The Code Scanning pack is supported when:
    • Using the CodeQL CLI version 2.23.9 in conjunction with a copy of the CodeQL standard library for C++ (github/codeql) set to the tag codeql-cli/v2.23.9.
    • Using the CodeQL Action or CodeQL runner with the codeql-bundle-v2.23.9.