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

`A2-7-3`: template function prototypes with comments are not correctly detected

Open rvermeulen opened this issue 1 year ago • 1 comments

Affected rules

  • cpp/autosar/undocumented-user-defined-type

Description

The query incorrect flags the function MyFunction.

Example

/// @brief MyFunction.
/// @tparam MyType template parameter.
/// @param  Parameter.
/// @return Return type.
template <typename MyType> auto MyFunction(MyType) -> MyType;

The condition c.getCommentedElement() = de doesn't hold for TemplateFunction.

rvermeulen avatar Feb 09 '24 20:02 rvermeulen

This happens when either:

  • The template function has no definition in the database.
  • The template function has no definition.

lcartey avatar Jun 03 '24 09:06 lcartey