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

`A2-7-3`: Certain `using` declarations are wrongly considered undocumented.

Open lcartey opened this issue 2 years ago • 2 comments

Affected rules

  • A2-7-3

Description

using declarations within functions do not detect colocated documentation.

Example

#include <type_traits>
template <typename Integer> void foo(Integer i) {
  /// documentation
  using unsigned_integer = std::make_unsigned_t<Integer>;
}

void test() {
  foo<int>(1);
  foo<unsigned int>(1);
}

lcartey avatar Oct 05 '23 09:10 lcartey

This also applies to usings in class scope when the original symbol is templated:

/// Documentation.
class A {
 public:
  /// Documentation.
  using U = std::uint32_t;
  /// Documentation.
  using V = std::vector<std::int32_t>;

  /// Documentation.
  template <class T>
  void Foo(T value) noexcept {
    static_cast<void>(value);
  }
};

Declaration entry for user-defined type V is missing documentation.

gg-sr avatar Feb 28 '24 23:02 gg-sr