github / codeql-coding-standards

This repository contains CodeQL queries and libraries which support various Coding Standards.
MIT License
110 stars 44 forks source link

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

Open rvermeulen opened 4 months ago

rvermeulen commented 4 months ago

Affected rules

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.

lcartey commented 1 month ago

This happens when either: