Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lcartey opened this issue Oct 5, 2023 · 2 comments
Open
Labels
Difficulty-High A false positive or false negative report which is expected to take 1+ week effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Low Standard-AUTOSAR user-report Issue reported by an end user of CodeQL Coding Standards

Comments

@lcartey
Copy link
Collaborator

lcartey commented Oct 5, 2023

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 lcartey added Difficulty-High A false positive or false negative report which is expected to take 1+ week effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Low user-report Issue reported by an end user of CodeQL Coding Standards labels Oct 5, 2023
@gg-sr
Copy link

gg-sr commented Feb 28, 2024

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.

@fjatWbyT
Copy link
Contributor

Ah, I am finding this issue now.

I think it is related to #709, where it appears that it is "not needed" to use function or class scope to reproduce the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty-High A false positive or false negative report which is expected to take 1+ week effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Low Standard-AUTOSAR user-report Issue reported by an end user of CodeQL Coding Standards
Projects
Development

No branches or pull requests

4 participants