codeql-coding-standards
codeql-coding-standards copied to clipboard
`A2-7-3`: Certain `using` declarations are wrongly considered undocumented.
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);
}
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.